Re: Using functions from Java packages

2012-12-17 Thread greg r
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

Re: Using functions from Java packages

2012-12-17 Thread greg r
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

Re: Using functions from Java packages

2012-12-16 Thread Softaddicts
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"

Re: Using functions from Java packages

2012-12-16 Thread Larry Travis
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

Re: Using functions from Java packages

2012-12-16 Thread Softaddicts
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

Re: Using functions from Java packages

2012-12-16 Thread Jim - FooBar();
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