From ddaef425764c532e8f0a75cb0f93bd300ec40634 Mon Sep 17 00:00:00 2001 From: Asumu Takikawa Date: Tue, 18 Sep 2012 13:35:28 -0400 Subject: [PATCH] define/match: fix docs & more examples --- collects/unstable/scribblings/match.scrbl | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/collects/unstable/scribblings/match.scrbl b/collects/unstable/scribblings/match.scrbl index f1a6741a2e..2ba2ee03f9 100644 --- a/collects/unstable/scribblings/match.scrbl +++ b/collects/unstable/scribblings/match.scrbl @@ -52,7 +52,8 @@ result value of @racket[rhs-expr], and continues matching each subsequent (define/match (head args) match*-clause ...) ([head id (head args)] - [args (arg ...)] + [args (code:line arg ...) + (code:line arg ... @#,racketparenfont{.} rest-id)] [arg arg-id [arg-id default-expr] (code:line keyword arg-id) @@ -80,6 +81,14 @@ result value of @racket[rhs-expr], and continues matching each subsequent [(_ _) #f]) ((f "ape") #:y '(5 2 3)) ((f "dog")) + + (define/match (g x y . rst) + [(0 0 '()) #t] + [(5 5 '(5 5)) #t] + [(_ _ _) #f]) + (g 0 0) + (g 5 5 5 5) + (g 1 2) ] }