no, the syntax is not the same. user=> (macroexpand-1 '(.foo bar)) (. bar foo)
On Mon, Apr 27, 2009 at 2:51 PM, Boris Mizhen <bo...@boriska.com> wrote: > > Hi Meikel, thanks for the answer. > > 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? > > After all the syntax to call them is the same :) > > Thanks, > Boris > > > On Apr 27, 5:34 pm, Meikel Brandmeyer <m...@kotka.de> wrote: >> Hi, >> >> Am 27.04.2009 um 23:17 schrieb Boris Mizhen: >> >> > ((comp #(Math/abs %) +) -3 -4) => 7 >> >> > How can I pass a static java function to another function? >> >> Here you already gave the answer to your question. Wrap it in >> a Clojure fn/#(). >> >> > A member function must be trickier because this must be supplied, but >> > perhaps a macro can be created that results in a function that would >> > capture this and call the member function appropriately ... >> >> #(.someMethod an-object %) >> >> Or passing in the object: >> >> #(.someMethod %1 %2) >> >> For apply and friends one needs a more elaborate way. >> Search for "rhickey jcall site:paste.lisp.org". >> >> Sincerely >> Meikel >> >> smime.p7s >> 5KViewDownload > > > -- And what is good, Phaedrus, And what is not good— Need we ask anyone to tell us these things? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---