add let*.
This commit is contained in:
parent
6d5811bb98
commit
6b54eb9d76
12
scm.mes
12
scm.mes
|
@ -80,3 +80,15 @@ EOF
|
||||||
(define-macro (let bindings . body)
|
(define-macro (let bindings . body)
|
||||||
(cons (cons 'lambda (cons (split-params bindings '()) body))
|
(cons (cons 'lambda (cons (split-params bindings '()) body))
|
||||||
(split-values bindings '())))
|
(split-values bindings '())))
|
||||||
|
|
||||||
|
(define (expand-let* bindings body)
|
||||||
|
(cond ((null bindings)
|
||||||
|
(cons (cons 'lambda (cons '() body)) '()))
|
||||||
|
(#t
|
||||||
|
(cons
|
||||||
|
(cons 'lambda (cons (cons (caar bindings) '())
|
||||||
|
(cons (expand-let* (cdr bindings) body) '())))
|
||||||
|
(cdar bindings)))))
|
||||||
|
|
||||||
|
(define-macro (let* bindings . body)
|
||||||
|
(expand-let* bindings body))
|
||||||
|
|
Loading…
Reference in a new issue