mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-18 21:29:19 +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
|
(begin
|
||||||
(define-syntax and-let*
|
(define-syntax and-let*
|
||||||
(syntax-rules ()
|
(syntax-rules ()
|
||||||
|
((and-let* ())
|
||||||
|
#t)
|
||||||
((and-let* () . body)
|
((and-let* () . body)
|
||||||
(begin #t . body))
|
(let* () . body))
|
||||||
((and-let* ((var expr)))
|
((and-let* ((var expr)))
|
||||||
expr)
|
expr)
|
||||||
((and-let* ((expr)))
|
((and-let* ((expr)))
|
||||||
|
|
|
@ -42,4 +42,6 @@
|
||||||
(let ((x #f)) (and-let* (x (y (- x 1)) ((positive? y))) (/ x y))))
|
(let ((x #f)) (and-let* (x (y (- x 1)) ((positive? y))) (/ x y))))
|
||||||
(test 3/2
|
(test 3/2
|
||||||
(let ((x 3)) (and-let* (x (y (- x 1)) ((positive? y))) (/ x y))))
|
(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))))
|
(test-end))))
|
||||||
|
|
Loading…
Add table
Reference in a new issue