sup. Any scheme ppl around?
(define-syntax let
(syntax-rules ()
[(_ ((x e) ...) b1 b2 ...)
((lambda (x ...) b1 b2 ...) e ...)]))
Not sure why scheme requires the three-dot syntax when mapping the pattern to the expression
for example, here: ((x e) ...)
is the pattern and I imagine it just "destructuring" the list that defines the let-bindings
but it is a bit weird that I cannot just write ((lambda (x) b1 b2 ...) e)
, both x
and e
require the three dots (or else it is a syntax error)
The book explanation: > the three pattern variables x, e, and b2 that appear in ellipsis prototypes in the pattern also appear in ellipsis prototypes in the template. This is not a coincidence; it is a requirement. In general, if a pattern variable appears within an ellipsis prototype in the pattern, it cannot appear outside an ellipsis prototype in the template.
I just don't find the explanation to satisfying, still wonder "why"
Also, not sure how to macro-expand in scheme 😬
(chez)
chez manuals can be quite unfriendly
can't believe emacs and scheme feels so unpolished even in 2020
can't find a version of scheme that runs smoothly on emacs+geiser on windows
and DrRacket is so clunky even for learning sigh
oh, this looks super cool: https://code.cs61a.org/