Yes. doto is more general now. The . is needed to indicate Java
interop calls because doto can do other things which are not Java
interop calls:
(doto "double" println println)
double
double
-> "double"
Stuart
> Can someone tell me whether this change was intentional? In the
> 20080916 release, I get this:
>
> user=> (doto (new java.util.HashMap) (.put "a" "b"))
> java.lang.IllegalArgumentException: No matching method found: .put
> java.lang.IllegalArgumentException: No matching method found: .put
> at clojure.lang.Reflector.invokeMatchingMethod(Reflector.java:44)
> at clojure.lang.Reflector.invokeInstanceMethod(Reflector.java:28)
> at user.eval__4117.invoke(Unknown Source)
> at clojure.lang.Compiler.eval(Compiler.java:3891)
> at clojure.lang.Repl.main(Repl.java:75)
> user=> (doto (new java.util.HashMap) (put "a" "b"))
> {a=b}
>
> In revision 1139, I get this:
>
> user=> (doto (new java.util.HashMap) (put "a" "b"))
> java.lang.Exception: Unable to resolve symbol: put in this context
> (NO_SOURCE_FILE:2)
> user=> (doto (new java.util.HashMap) (.put "a" "b"))
> #=(java.util.HashMap. {"a" "b"})
>
> I'm using JRE 1.6.0.10.
>
> Bill Smith
> >
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---