support 'else' syntax in cond

This commit is contained in:
Yuichi Nishiwaki 2014-02-08 02:55:17 +09:00
parent 15e95f82da
commit f051de77c5
1 changed files with 5 additions and 3 deletions

View File

@ -53,9 +53,11 @@
(let ((clauses (cdr expr))) (let ((clauses (cdr expr)))
(if (null? clauses) (if (null? clauses)
#f #f
(list (r 'if) (caar clauses) (if (compare (r 'else) (caar clauses))
(cons (r 'begin) (cdar clauses)) (cons (r 'begin) (cdar clauses))
(cons (r 'cond) (cdr clauses)))))))) (list (r 'if) (caar clauses)
(cons (r 'begin) (cdar clauses))
(cons (r 'cond) (cdr clauses)))))))))
(define-syntax and (define-syntax and
(er-macro-transformer (er-macro-transformer