On 30 Aug 2010, at 23:18, Frederic Koehler wrote:
I accidentally noticed this:
On clojure 1.2, macroexpanding with a function name which is a class,
causes this ugly error:
(macroexpand '(Object))
java.lang.Exception: Expecting var, but Object is mapped to class
java.lang.Object (repl-1:2)
when presumably it should just give '(Object).
I have no clue for any actual use cases of naming your functions after
classes, but:
(let [Object (fn [] 3)] (Object))
is technically valid clojure code, so macroexpand shouldn't just
die...
You are right that
(let [Object (fn [] 3)] (Object))
is valid Clojure code, and it works as expected. However,
(Object)
is not a valid expression. It fails with exactly the same error
message as
(macroexpand '(Object))
so I'd say this is consistent behaviour.
Konrad.
--
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