On Apr 27, 5:51 pm, Boris Mizhen <bo...@boriska.com> wrote:
> I wonder if someone could explain or point me to the explanation about
> *why* a Java static fn can't be passed just like a closure fn?

The only reason I can give you is that Java methods aren't first-class
objects, like Clojure fns.

The (.method object) and (SomeClass/method ...) forms are syntactic
sugar, that expand to a special form:

user> (macroexpand '(.method object argument))
(. object method argument)
user> (macroexpand '(Class/method argument))
(. Class method argument)

Perhaps the compiler could automatically wrap Java methods when they
are used as a value, but that might not be easy or efficient to
implement.

-Stuart Sierra
--~--~---------~--~----~------------~-------~--~----~
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