Hello all! Today, I've either discovered a bug, or I've discovered a
flaw in my understanding of macros. Most likely the latter :-) Could
anyone set me straight?

While this is not the macro I was trying to write, it falls over in
the same place.

(user=> (defmacro foo [& xs] `(map identity ~xs))
#'user/foo
user=> (foo 1 2)
java.lang.ClassCastException: java.lang.Integer cannot be cast to
clojure.lang.IFn (NO_SOURCE_FILE:0)

However, this does work (though it doesn't feel idiomatic).

user=> (defmacro foo [& xs] `(map identity [...@xs]))
#'user/foo
user=> (foo 1 2)
(1 2)

I have tried this on todays (July 7) bleeding edge and 1.1 with the
same results.

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