[bugfix] case and or should be declared by ir-macro-transformer
This commit is contained in:
parent
daae383938
commit
1ad4c309f4
|
@ -612,7 +612,7 @@
|
||||||
(make-syntactic-closure mac-env '() (unwrap (f (wrap expr) inject compare))))))
|
(make-syntactic-closure mac-env '() (unwrap (f (wrap expr) inject compare))))))
|
||||||
|
|
||||||
(define-syntax or
|
(define-syntax or
|
||||||
(er-macro-transformer
|
(ir-macro-transformer
|
||||||
(lambda (expr inject compare)
|
(lambda (expr inject compare)
|
||||||
(let ((exprs (cdr expr)))
|
(let ((exprs (cdr expr)))
|
||||||
(if (null? exprs)
|
(if (null? exprs)
|
||||||
|
@ -623,14 +623,14 @@
|
||||||
(or ,@(cdr exprs)))))))))
|
(or ,@(cdr exprs)))))))))
|
||||||
|
|
||||||
(define-syntax case
|
(define-syntax case
|
||||||
(er-macro-transformer
|
(ir-macro-transformer
|
||||||
(lambda (expr inject compare)
|
(lambda (expr inject compare)
|
||||||
(let ((key (cadr expr))
|
(let ((key (cadr expr))
|
||||||
(clauses (cddr expr)))
|
(clauses (cddr expr)))
|
||||||
`(let ((key ,key))
|
`(let ((key ,key))
|
||||||
,(let loop ((clauses clauses))
|
,(let loop ((clauses clauses))
|
||||||
(if (null? clauses)
|
(if (null? clauses)
|
||||||
'#f
|
#f
|
||||||
`(if (or ,@(map (lambda (x) `(eqv? key ,x)) (caar clauses)))
|
`(if (or ,@(map (lambda (x) `(eqv? key ,x)) (caar clauses)))
|
||||||
,@(cdar clauses)
|
,@(cdar clauses)
|
||||||
,(loop (cdr clauses))))))))))
|
,(loop (cdr clauses))))))))))
|
||||||
|
|
Loading…
Reference in New Issue