I'll try to extend Mike's answer by one more example. Consider `and`
Lisp macro. It is not a function, because it must evaluate it's
arguments lazily, and using macros is the only way to do it. But try
to apply `and` to the list of values (I know, that it's a job for a
function `every?`, but how will you implement this function itself?):

(apply and (list true true false true))   ==> error

You cannot do it, since and is not a function. So, you need to use
wrapper around `and`:

(reduce #(and %1 %2) (list true true false true))  ==> false

And this is still not the perfect solution, since it is not lazy.

So you can see both advantages and disadvantages of using macros.

-- 
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

Reply via email to