In clojure, how to apply a macro to a list?

You don’t.

Macros are expanded during evaluation/compile time, not at runtime, thus the only information they can use are the args passed in, but not what the args evaluate to at runtime. That’s why a literal vector works, because that literal vector is there at compile time, but a is just a symbol; it will only evaluate to a vector at runtime.

To have and-like behaviour for lists, use (every? identity coll).

To have or-like behaviour for lists, use (some identity coll).

Leave a Comment