match: specify failure, and add byte strings as patterns
svn: r8540
This commit is contained in:
parent
52355ec9e6
commit
8efa991f4f
|
@ -38,6 +38,7 @@ literal ::= () @match the empty list
|
|||
| #t @match true
|
||||
| #f @match false
|
||||
| string @match equal% string
|
||||
| bytes @match equal% byte string
|
||||
| number @match equal% number
|
||||
| char @match equal% character
|
||||
lvp ::= (code:line pat ooo) @greedily match pat instances
|
||||
|
@ -113,7 +114,7 @@ ooo ::= *** @zero or more; *** is literal
|
|||
[(symbol? s)
|
||||
(case s
|
||||
[(lvp pat qp literal ooo datum struct-id
|
||||
string number character expr id
|
||||
string bytes number character expr id
|
||||
rx-expr px-expr pred-expr
|
||||
derived-pattern)
|
||||
(match-nonterm (symbol->string s))]
|
||||
|
|
|
@ -24,6 +24,9 @@ bindings introduced by @scheme[pat] (if any). The last @scheme[expr]
|
|||
in the matching clause is evaluated in tail position with respect to
|
||||
the @scheme[match] expression.
|
||||
|
||||
The @scheme[clause]s are tried in order to find a match. If no
|
||||
@scheme[clause] matches, then the @exnraise[exn:fail].
|
||||
|
||||
An optional @scheme[(=> identifier)] between a @scheme[pat] and the
|
||||
@scheme[expr]s is bound to a @defterm{failure procedure} of zero
|
||||
arguments. If this procedure is invoked, it escapes back to the
|
||||
|
|
Loading…
Reference in New Issue
Block a user