mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-20 14:19:18 +02:00
non-standard extension - allowing empty expressions in case clauses
This commit is contained in:
parent
34c1b86137
commit
e7dbddadef
1 changed files with 7 additions and 3 deletions
|
@ -271,9 +271,13 @@
|
||||||
(er-macro-transformer
|
(er-macro-transformer
|
||||||
(lambda (expr rename compare)
|
(lambda (expr rename compare)
|
||||||
(define (body exprs)
|
(define (body exprs)
|
||||||
(if (compare (rename '=>) (car exprs))
|
(cond
|
||||||
`(,(cadr exprs) ,(rename 'tmp))
|
((null? exprs)
|
||||||
`(,(rename 'begin) ,@exprs)))
|
(rename 'tmp))
|
||||||
|
((compare (rename '=>) (car exprs))
|
||||||
|
`(,(cadr exprs) ,(rename 'tmp)))
|
||||||
|
(else
|
||||||
|
`(,(rename 'begin) ,@exprs))))
|
||||||
(define (clause ls)
|
(define (clause ls)
|
||||||
(cond
|
(cond
|
||||||
((null? ls) #f)
|
((null? ls) #f)
|
||||||
|
|
Loading…
Add table
Reference in a new issue