On Dec 16, 2:32 pm, Stuart Halloway <[email protected]> wrote:
> Hi Randall,
>
> The syntactic sugar forms are reader behavior, and occur too soon: at
> read time, not macro expansion time.
>
Actually, the dot sugar is not reader magic, but macroexpansion, as
documented here:
http://clojure.org/java_interop
(read-string "(java.util.ArrayList.)")
-> (java.util.ArrayList.) ;a list with one symbol
(macroexpand (read-string "(java.util.ArrayList.)"))
-> (new java.util.ArrayList)
(eval (read-string "(java.util.ArrayList.)"))
-> #=(java.util.ArrayList. [])
> Macros need to expand to real forms, not reader shortcuts.
>
That's generally true, but does not apply here, because Classname. is
a regular symbol reader-wise.
Rich
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---