3 ms·
I like the macro transformers in R5RS Scheme. Here's how the multi-binding if-let and when-let look: (define-syntax if-let (syntax-rules () ((if-le
by brlewis 8y ago
I like the macro transformers in R5RS Scheme. Here's how the multi-binding if-let and when-let look:
(define-syntax if-let
(syntax-rules ()
((if-let ((var value) ...)
consequent ...)
(let ((var value) ...)
(if (and var ...)
consequent ...)))))
(define-syntax when-let
(syntax-rules ()
((when-let (binding)
body ...)
(if-let (binding)
(begin body ...)))))
- shawn 8y agoArc has corrupted me to barely be able to tolerate all those parens. (mac iflet (var condition . body) `(let ,var ,condition (if ,var ,@body))) (mac whenlet (var condition . body) `(iflet ,var ,condition (do ,@body)))
- christianbryant 8y agoWhat kind of project are you working on with Arc? Or are you just having fun for now ;-)