Fork me on GitHub
#other-lisps
<
2020-04-30
>
EmmanuelOga06:04:11

sup. Any scheme ppl around?

EmmanuelOga06:04:28

(define-syntax let
  (syntax-rules ()
    [(_ ((x e) ...) b1 b2 ...)
     ((lambda (x ...) b1 b2 ...) e ...)]))

EmmanuelOga06:04:01

Not sure why scheme requires the three-dot syntax when mapping the pattern to the expression

EmmanuelOga06:04:03

for example, here: ((x e) ...) is the pattern and I imagine it just "destructuring" the list that defines the let-bindings

EmmanuelOga06:04:49

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)

EmmanuelOga06:04:12

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.

EmmanuelOga06:04:26

I just don't find the explanation to satisfying, still wonder "why"

EmmanuelOga06:04:50

Also, not sure how to macro-expand in scheme 😬

EmmanuelOga06:04:08

chez manuals can be quite unfriendly

EmmanuelOga07:04:50

can't believe emacs and scheme feels so unpolished even in 2020

EmmanuelOga07:04:14

can't find a version of scheme that runs smoothly on emacs+geiser on windows

EmmanuelOga07:04:37

and DrRacket is so clunky even for learning sigh