Thanks to all who replied.

To summarize what I learned  - Clojure has a special form (. ) to
*call* java functions, but does not have concept of a *value*
corresponding to a java function.
This makes Java functions a second class citizen :)

In addition special forms are expanded in the first position of the
list, but not on other positions, thus in (foo Math/abs)  Math/abs is
no longer a syntax for a static method, but a lookup of a var 'abs' in
a namespace Math.

Correct?

Regards,
Boris

On Apr 27, 7:28 pm, Timothy Pratley <timothyprat...@gmail.com> wrote:
> > How can I pass a static java function to another function?
>
> There is also memfn:
> (memfn name & args)
> Macro
> Expands into code that creates a fn that expects to be passed an
> object and any args and calls the named instance method on the object
> passing the args. Use when you want to treat a Java method as a first-
> class fn.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to