3 ms·
If you're trying to get things done in Racket, just learn define-syntax-rule [1] and syntax/parse [2]. You also picked as your example the one thing unhygienic
by kogir 13y ago
If you're trying to get things done in Racket, just learn define-syntax-rule [1] and syntax/parse [2].
You also picked as your example the one thing unhygienic macros are good at. Even in arc.arc, most macros start with (w/uniq (let boilerplate like:
(mac or args
(and args
(w/uniq g
`(let ,g ,(car args)
(if ,g ,g (or ,@(cdr args)))))))
In my code breaking hygiene is the exception, not the common case, and my Racket macros are usually shorter than the equivalent arc macros.
[1]: http://docs.racket-lang.org/guide/pattern-macros.html
[2]: http://docs.racket-lang.org/syntax/stxparse.html