match: Don't ever avoid let-binding the matched expression (since

identifiers can have non-trivial effects).  Bug pointed out by RMC.

svn: r3813
This commit is contained in:
Sam Tobin-Hochstadt 2006-07-25 19:10:14 +00:00
parent 1e1dfdc13c
commit aac8dfdbe5

View File

@ -15,10 +15,8 @@
(define-syntax (match stx)
(syntax-case stx ()
[(_ exp . clauses)
(if (identifier? #'exp)
(gen-match #'exp '() #'clauses stx)
(with-syntax ([body (gen-match #'x '() #'clauses stx)])
#`(let ((x exp)) body)))]))
(with-syntax ([body (gen-match #'x '() #'clauses stx)])
#`(let ([x exp]) body))]))
(define-syntax (match-lambda stx)
(syntax-case stx ()