On Feb 3, 2009, at 10:32 PM, kyle smith wrote:

(map #(doto %1 (.add 2)) (doto (new java.util.ArrayList) (.add 1)))

user=> (map #(doto %1 (.add 2)) (doto (new java.util.ArrayList) (.add 1))) java.lang.IllegalArgumentException: No matching method found: add for class java.lang.Integer

The inner doto form evaluates to an ArrayList containing one element: 1.

Mapping the function literal across that collection ends up requesting evaluation of:

(doto 1 (.add 2))

Integer has no method "add", so that fails.

--Steve

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

Reply via email to