[bugfix] case and or should be declared by ir-macro-transformer

This commit is contained in:
Yuichi Nishiwaki 2013-12-09 15:41:57 +09:00
parent daae383938
commit 1ad4c309f4
1 changed files with 3 additions and 3 deletions

View File

@ -612,7 +612,7 @@
(make-syntactic-closure mac-env '() (unwrap (f (wrap expr) inject compare))))))
(define-syntax or
(er-macro-transformer
(ir-macro-transformer
(lambda (expr inject compare)
(let ((exprs (cdr expr)))
(if (null? exprs)
@ -623,14 +623,14 @@
(or ,@(cdr exprs)))))))))
(define-syntax case
(er-macro-transformer
(ir-macro-transformer
(lambda (expr inject compare)
(let ((key (cadr expr))
(clauses (cddr expr)))
`(let ((key ,key))
,(let loop ((clauses clauses))
(if (null? clauses)
'#f
#f
`(if (or ,@(map (lambda (x) `(eqv? key ,x)) (caar clauses)))
,@(cdar clauses)
,(loop (cdr clauses))))))))))