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

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to