allow `else` and `=>` keyword in `case`
This commit is contained in:
parent
d71666624b
commit
0fea822ac0
|
@ -263,10 +263,14 @@
|
|||
,(let loop ((clauses clauses))
|
||||
(if (null? clauses)
|
||||
#f
|
||||
`(,(r 'if) (,(r 'or)
|
||||
,@(map (lambda (x) `(,(r 'eqv?) ,(r 'key) (,(r 'quote) ,x)))
|
||||
(caar clauses)))
|
||||
(begin ,@(cdar clauses))
|
||||
`(,(r 'if) ,(if (compare (r 'else) (caar clauses))
|
||||
'#t
|
||||
`(,(r 'or)
|
||||
,@(map (lambda (x) `(,(r 'eqv?) ,(r 'key) (,(r 'quote) ,x)))
|
||||
(caar clauses))))
|
||||
,(if (compare (r '=>) (cadar clauses))
|
||||
`(,(r 'begin) ,@(cddar clauses))
|
||||
`(,(r 'begin) ,@(cdar clauses)))
|
||||
,(loop (cdr clauses))))))))))
|
||||
|
||||
(define-syntax syntax-error
|
||||
|
|
Loading…
Reference in New Issue