Arc Forumnew | comments | leaders | submitlogin
1 point by akkartik 4465 days ago | link | parent

Macros now warn when called with spliced args: http://github.com/akkartik/wart/commit/1ad7da8d6f

After sleeping on it I'm less bummed. Macros aren't a clean, well-behaved tool anyway. They're open to variable capture. You have to be careful with multiple evaluation. And now you can use apply with them, but you'll have to be careful. I'm happy with warning the user about it. (Though I'm still interested in a better replacement for apply/splice.)



1 point by akkartik 4464 days ago | link

Is there a manual workaround for macros' limitations with splice? The way we use gensyms to get around their limitations with variable capture?

I've been playing with this idea:

  (def quotify(f) (fn 'args (f @args)))
Now I can turn the final example into:

  wart> = x '(1 2)
  wart> (and @(quotify.list x))
  (1 2) ; woohoo!
However it doesn't seem to help with the definition of all-true..

-----