I suspect I will be asking more questions, so in order not to start
another thread I will post below :)

Why
((comp - +) -3 -4) => 7

but

((comp Math/abs +) -3 -4) => Error?
java.lang.Exception: No such namespace: Math (NO_SOURCE_FILE:1)
  [Thrown class clojure.lang.Compiler$CompilerException]

and
((comp #(Math/abs %) +) -3 -4) => 7

Is there an inherent difference between java and clojure functions, so
Java functions can't be passed as arguments? Or am I missing
something?

How can I pass a static java function to another function?

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 ...

Thank you,
Boris


On Apr 27, 4:26 pm, Boris Mizhen <bo...@boriska.com> wrote:
> Hello all,
> It seems to me that areduce can not be used with an anonymous array.
> Consider:
>
> (areduce (.. System getProperties values toArray) i r 0
> (some_expression))
>
> It seems to me that there is no way to get i'th element of the array
> in (some_expression) other than let'-ing it first.
> It would be nice to be able to pass the name for the current element
> or define a local macro that expands to
> (aref #a i) - here #a is a gensym for the array itself ...
>
> Thought?
>
> Boris
--~--~---------~--~----~------------~-------~--~----~
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