mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-19 05:39:18 +02:00
Fix and-let* so that it allows bodies according to SRFI 2.
This commit is contained in:
parent
12636f4b19
commit
306dbd470a
2 changed files with 5 additions and 1 deletions
|
@ -5,8 +5,10 @@
|
|||
(begin
|
||||
(define-syntax and-let*
|
||||
(syntax-rules ()
|
||||
((and-let* ())
|
||||
#t)
|
||||
((and-let* () . body)
|
||||
(begin #t . body))
|
||||
(let* () . body))
|
||||
((and-let* ((var expr)))
|
||||
expr)
|
||||
((and-let* ((expr)))
|
||||
|
|
|
@ -42,4 +42,6 @@
|
|||
(let ((x #f)) (and-let* (x (y (- x 1)) ((positive? y))) (/ x y))))
|
||||
(test 3/2
|
||||
(let ((x 3)) (and-let* (x (y (- x 1)) ((positive? y))) (/ x y))))
|
||||
(test 5 (and-let* () (define x 5) x))
|
||||
(test 6 (and-let* ((x 6)) (define y x) y))
|
||||
(test-end))))
|
||||
|
|
Loading…
Add table
Reference in a new issue