3 ms·
A while ago, I wrote this little macro which does the same thing in racket: (define-syntax (-> x) (let ((arg (cdr (syntax-e x)))) (foldl
by m1el 9y ago
A while ago, I wrote this little macro which does the same thing in racket:
(define-syntax (-> x)
(let ((arg (cdr (syntax-e x))))
(foldl (λ (l r)
(if (identifier? l)
#`(#,l #,r)
#`(#,@l #,r)))
(car arg) (cdr arg))))
Same ideas showing up again and again. Pretty cool, I guess.