mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-19 05:39:18 +02:00
allow rest param in let-optionals
This commit is contained in:
parent
58e10b2a7d
commit
f4b0277d01
2 changed files with 8 additions and 2 deletions
|
@ -16,6 +16,12 @@
|
|||
((opt-lambda (a (b 11) (c 12))
|
||||
(list a b c))
|
||||
0))
|
||||
(test '(0 1 (2 3 4))
|
||||
(let-optionals* '(0 1 2 3 4) ((a 10) (b 11) . c)
|
||||
(list a b c)))
|
||||
(test '(0 1 (2 3 4))
|
||||
(let-optionals '(0 1 2 3 4) ((a 10) (b 11) . c)
|
||||
(list a b c)))
|
||||
(test-error '(0 11 12)
|
||||
((opt-lambda (a (b 11) (c 12))
|
||||
(list a b c))))
|
||||
|
|
|
@ -51,8 +51,8 @@
|
|||
|
||||
(define-syntax let-optionals
|
||||
(syntax-rules ()
|
||||
((let-optionals ls ((var default) ...) body ...)
|
||||
(let*-to-let let-optionals* ls () ((var default) ...) body ...))))
|
||||
((let-optionals ls ((var default) ... . rest) body ...)
|
||||
(let*-to-let let-optionals* ls () ((var default) ... . rest) body ...))))
|
||||
|
||||
;;> \macro{(let-optionals* ls ((var default) ... [rest]) body ...)}
|
||||
;;>
|
||||
|
|
Loading…
Add table
Reference in a new issue