SRFI 61 port
svn: r1702
This commit is contained in:
parent
6745d9c651
commit
af9b25ff0f
|
@ -11,31 +11,20 @@
|
|||
(if #t (begin else1 else2 ...)))
|
||||
((_ (test => receiver) more-clause ...)
|
||||
(let ((t test))
|
||||
(cond/maybe-more t
|
||||
(receiver t)
|
||||
more-clause ...)))
|
||||
(if t
|
||||
(receiver t)
|
||||
(my-cond more-clause ...))))
|
||||
((_ (generator guard => receiver) more-clause ...)
|
||||
(call-with-values (lambda () generator)
|
||||
(lambda t
|
||||
(cond/maybe-more (apply guard t)
|
||||
(apply receiver t)
|
||||
more-clause ...))))
|
||||
(if (apply guard t)
|
||||
(apply receiver t)
|
||||
(my-cond more-clause ...)))))
|
||||
((_ (test) more-clause ...)
|
||||
(let ((t test))
|
||||
(cond/maybe-more t t more-clause ...)))
|
||||
((_ (test body1 body2 ...) more-clause ...)
|
||||
(cond/maybe-more test
|
||||
(begin body1 body2 ...)
|
||||
more-clause ...))
|
||||
(or test (my-cond more-clause ...)))
|
||||
((_ (test body ...) more-clause ...)
|
||||
(if test
|
||||
(begin body ...)
|
||||
(my-cond more-clause ...)))
|
||||
((_)
|
||||
(cond))))
|
||||
|
||||
(define-syntax cond/maybe-more
|
||||
(syntax-rules ()
|
||||
((_ test consequent)
|
||||
(if test
|
||||
consequent))
|
||||
((_ test consequent clause ...)
|
||||
(if test
|
||||
consequent
|
||||
(my-cond clause ...))))))
|
||||
(void)))))
|
Loading…
Reference in New Issue
Block a user