Another possibility is the macro memfn. From the documentation:
http://clojure.github.com/clojure/clojure.core-api.html#clojure.core/memfn
Regards,
Greg
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@go
Another possibility is the macro memfn. From the documentation:
http://clojure.github.com/clojure/clojure.core-api.html#clojure.core/memfn
Regards,
Greg
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@go
The problem if you dive into Java is that it may bring to your attention a
myriad of details
that may not be worth the trouble of learning if you do not expect to
dive into Java and stay on the Clojure side of the fence.
No ready-fit light reading comes to my mind. Maybe a "learn java in 21 days"
Thank you, gentlemen. Jim and Luc, your answers are both helpful. Luc's
answer illustrates why a Java tyro often has problems understanding
Clojure. Somebody like me who is trying to master Clojure, having come
to it via a language path that doesn't include Java, needs a
prerequisite crash cour
First example tries to access a public static field in the Math class.
Second example calls the static member function of the Math class.
The difference is in the missing set of parenthesis.
A static field or member function is attached to the class, not to a specific
object
and can be accessed
Java methods are not first-class...you cannot use them like that...you
need an object to call the method on...by wrapping the java call with an
anonymous fn you are able to use Math/sqrt as 1st-class...
Hope it is clearer now...
Jim
On 16/12/12 19:33, Larry Travis wrote:
It almost certainly h
It almost certainly has something to do with my abysmal ignorance about
things Java, but I don't understand this difference:
(1)
user> (map Math/sqrt [5 6 16])
Unable to find static field: sqrt in class java.lang.Math
[Thrown class java.lang.RuntimeException]
(2)
user> (map #(Math/sqrt