This is confusing. First, if you read the docs, they begin with:

---------------------------------
(Classname. args*)
(new Classname args*)
Special form.
---------------------------------

Only if  you read further do you discover that (Classname. args*) is  
not a special form but a macro. Also, it is a macro that cannot be  
written in Clojure, that is, a "special macroexpansion" per the docs.

So a special macroexpansion is reader-macro-like, in that it involves  
a special syntax rules not available to normal Clojure code, but macro- 
like in that it expands at macroexpansion time.

Is that right?

Stuart

> On Dec 16, 2:32 pm, Stuart Halloway <stuart.hallo...@gmail.com> 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 clojure@googlegroups.com
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