Fix bug in match reported by jay.

svn: r18563
This commit is contained in:
Sam Tobin-Hochstadt 2010-03-17 18:21:09 +00:00
parent 06f25d1359
commit e1eb4a4b93
2 changed files with 11 additions and 1 deletions

View File

@ -206,7 +206,7 @@
#:when (for/and ([seen-var seen])
(not (free-identifier=? bv (car seen-var)))))
bv)])
(with-syntax ([(success? var ...) (append (generate-temporaries '(success?)) vars)])
(with-syntax ([(esc* success? var ...) (append (generate-temporaries '(esc* success?)) vars)])
;; do the or matching, and bind the results to the appropriate
;; variables
#`(let ([esc* (lambda () (values #f #,@(for/list ([v vars]) #'#f)))])

View File

@ -633,5 +633,15 @@
(match (make-pose 1 2 3)
[(struct pose (x y a)) "Gotcha!"]
[else "Epic fail!"])))
(comp #f
(match (list 'a 'b 'c)
[(or (list a b)
(and (app (lambda _ #f) b)
(or (and (app (lambda _ #f) a)
(list))
(list a))))
#t]
[_ #f]))
))