Just to be clear, is (String.) a macro? I thought it was just a special
form.

On Mon, Jun 8, 2009 at 3:47 PM, Stephen C. Gilardi <squee...@mac.com> wrote:

>
> On Jun 8, 2009, at 12:38 PM, ronen wrote:
>
> user=> (-> String. String.)
> java.lang.ClassNotFoundException: String. (NO_SOURCE_FILE:7)
>
> expanding the macros involved seems to reveal the issue:
>
> user=> (macroexpand-1 `(-> String. String.))
> (java.lang.String. java.lang.String.)
>
> the "." macro isn't expanded.
>
>
> The trailing dot syntax is used for creating an object given a class name:
>
> (String.)
>
> creates a String object.
>
> Nested macros work fine. What were you hoping the above expressions would
> expand to?
>
> Here's an example of -> in action:
>
> (-> (System/getProperties) (.get "java.class.path") .toUpperCase (nth 3)
> int (* 2))
>
> --Steve
>
>

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