Doesn't extend to arbitrary number of arguments, though.
that was sorta a deal-breaker. :)
A broader analysis of this: because macros work at compile-time, not
at runtime, you need to know the number of arguments in advance. That
means that any solution which requires a variable number of arguments
to be passed to a macro -- such as getting its effects at runtime
using apply -- can't work, and must be avoided or solved using eval
(as DanL mentioned).
(Or one of the arguments needs to be a sequence, and the macro expands
into code that walks it at runtime. That's still a fixed number of
arguments.)
In Lisps, there are usually two solutions to this:
* Have a complementary version: statically one uses 'and', dynamically
one uses 'every?'. Often the dynamic version is implemented in terms
of the static version.
* Provide only the dynamic version, and use a compiler macro to get
some static benefits. This solution isn't available (at least to user
code) in Clojure.
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en