add hygienic `or` syntax

This commit is contained in:
Yuichi Nishiwaki 2013-12-09 15:37:29 +09:00
parent 3c6fd93b5a
commit daae383938
1 changed files with 11 additions and 0 deletions

View File

@ -611,6 +611,17 @@
(identifier=? use-env x use-env y))
(make-syntactic-closure mac-env '() (unwrap (f (wrap expr) inject compare))))))
(define-syntax or
(er-macro-transformer
(lambda (expr inject compare)
(let ((exprs (cdr expr)))
(if (null? exprs)
#f
`(let ((it ,(car exprs)))
(if it
it
(or ,@(cdr exprs)))))))))
(define-syntax case
(er-macro-transformer
(lambda (expr inject compare)