2011/9/27 ru <soro...@oogis.ru>

>
> user=> (defmacro infix [e] `(let [[x# f# y#] ~e] (f# x# y#)))
> #'user/infix
> user=> (infix (5 + 4))
> java.lang.ClassCastException: java.lang.Integer cannot be cast to
> clojure.lang.IFn (NO_SOURCE_FILE:0)
>
> I insist that expansion is not quite correct. Am I right?


Your macro expands the source into an incorrect form. Better versions have
already been given.

David

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