3 ms·
> Well, you've implemented let* : (let* ((a 1) (b a)) (+ a b)) I think this should just be plain let. If I do: (define-syntax let- (syntax-ru
by _emacsomancer_ 6y ago
> Well, you've implemented let* :
(let* ((a 1) (b a)) (+ a b))
I think this should just be plain let.
If I do:
(define-syntax let-
(syntax-rules ()
[(_ ((x e) ...) b1 b2 ...)
((lambda (x ...) b1 b2 ...) e ...)]))
And then try:
(let- ((a 2) (b a)) (+ a b))
I get:
; a: undefined;
; cannot reference an identifier before its definition
; in module: top-level
- bjoli 6y agoI don't really understand if you are surprised by that or not. That is the expected behaviour of regular let. Parallel binding. let* is sequential.
- _emacsomancer_ 6y agoI'm not surprised by that. The parent suggested (or I thought that they did) that this was actually the definition for let* . And my point was to show that it does not behave like let* but rather like plain let.