add when and unless macros

This commit is contained in:
Yuichi Nishiwaki 2013-11-06 16:18:29 +09:00
parent fc42c71304
commit d0d3feeb4b
1 changed files with 6 additions and 0 deletions

View File

@ -115,6 +115,12 @@
(define else #t)
(define-macro (when test . exprs)
(list 'if test (cons 'begin exprs) #f))
(define-macro (unless test . exprs)
(list 'if test #f (cons 'begin exprs)))
(define-macro (and . exprs)
(if (null? exprs)
#t