From 8efa991f4fb0cd83616444ee7ebd5c0f5efe365e Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Tue, 5 Feb 2008 16:59:54 +0000 Subject: [PATCH] match: specify failure, and add byte strings as patterns svn: r8540 --- collects/scribblings/reference/match-grammar.ss | 3 ++- collects/scribblings/reference/match.scrbl | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/collects/scribblings/reference/match-grammar.ss b/collects/scribblings/reference/match-grammar.ss index 754bf08467..5fb30c1b8c 100644 --- a/collects/scribblings/reference/match-grammar.ss +++ b/collects/scribblings/reference/match-grammar.ss @@ -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))] diff --git a/collects/scribblings/reference/match.scrbl b/collects/scribblings/reference/match.scrbl index dd408b9db1..8b5ecf2264 100644 --- a/collects/scribblings/reference/match.scrbl +++ b/collects/scribblings/reference/match.scrbl @@ -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