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:
parent
1e1dfdc13c
commit
aac8dfdbe5
|
@ -15,10 +15,8 @@
|
||||||
(define-syntax (match stx)
|
(define-syntax (match stx)
|
||||||
(syntax-case stx ()
|
(syntax-case stx ()
|
||||||
[(_ exp . clauses)
|
[(_ exp . clauses)
|
||||||
(if (identifier? #'exp)
|
|
||||||
(gen-match #'exp '() #'clauses stx)
|
|
||||||
(with-syntax ([body (gen-match #'x '() #'clauses stx)])
|
(with-syntax ([body (gen-match #'x '() #'clauses stx)])
|
||||||
#`(let ((x exp)) body)))]))
|
#`(let ([x exp]) body))]))
|
||||||
|
|
||||||
(define-syntax (match-lambda stx)
|
(define-syntax (match-lambda stx)
|
||||||
(syntax-case stx ()
|
(syntax-case stx ()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user