{"size": 1428, "ext": "scrbl", "max_stars_repo_path": "define-match-spread-out/scribblings/define-match-spread-out.scrbl", "max_stars_repo_name": "AlexKnauth/define-match-spread-out", "max_stars_repo_stars_event_min_datetime": "2015-05-21T09:01:04.000Z", "max_stars_repo_stars_event_max_datetime": "2015-05-21T09:01:04.000Z", "max_issues_repo_path": "define-match-spread-out/scribblings/define-match-spread-out.scrbl", "max_issues_repo_name": "AlexKnauth/define-match-spread-out", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "define-match-spread-out/scribblings/define-match-spread-out.scrbl", "max_forks_repo_name": "AlexKnauth/define-match-spread-out", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 29.1428571429, "max_line_length": 72, "alphanum_fraction": 0.6407563025}
#lang scribble/manual

@(require scribble-code-examples
          (for-label racket/base
                     racket/contract/base
                     define-match-spread-out
                     defpat/match-case-lambda
                     ))

@title{define-match-spread-out}

source code: @url{https://github.com/AlexKnauth/define-match-spread-out}

@defmodule[define-match-spread-out]{
This file provides the @racket[define*] form, which allows function
definitions to be spread out across a file.
}

@defform[(define* (f-id args) body ...)
         #:grammar
         ([args
           (code:line arg-pat ...)
           (code:line @#,racketparenfont{.} rest-id)
           (code:line arg-pat ... @#,racketparenfont{.} rest-id)])]{
A version of @racket[define] that allows definitions to be spread
across a file. Each @racket[arg-pat] can be an arbitrary
@racket[match] pattern, and if the given argument values don't match
the patterns in the first form in the file, it tries matching them
against the patterns in second form, and so on.

The patterns of all of the @racket[define*] forms in the file so far
are collected into a single @racket[match*-case-lambda] form.

@code-examples[#:lang "racket/base" #:context #'here]{
(require define-match-spread-out)
(define* (f #t) 2)
(f #t)
(define* (f #f) 3)
(f #t)
(f #f)
(define* (f _) 0)
(f #t)
(f "non-boolean stuff")
(define* (f x y) x)
(f #t)
(f "two" "arguments")
}}

