4 ms·
To add on, Racket in particular has some very slick syntax for writing these kinds of things: (define-syntax-rule (let ([id expr] ...) body ...) ((λ
by disconcision 8y ago
To add on, Racket in particular has some very slick syntax for writing these kinds of things:
(define-syntax-rule
(let ([id expr] ...) body ...)
((λ (id ...) body ...) expr ...))
- yomly 8y agoI definitely liked this about Racket but I did also find the elipses to be a bit magic to begin with...
- disconcision 8y agoAs with all things, the trick to chase the magic away is to implement them. I recently made a little term rewriting library using racket/match syntax but with the pattern/templates specifiable at runtime. Ellipses were a bit confusing to begin with but when you break list patterns down into cons pairs + a cons-like pattern binary combinator to represent ellipses, it started making sense. The unexpected thing for me was that I thought nested ellipses were going to be the tough part, but it turns out they actually just... work.