Is there a way of invoking functions, or java methods "by name" in
Clojure?
Or, put another way, why does this work:

(+ 1 2)

but this does not:

((symbol "+") 1 2)

Similarly, this works

(. javaObj (methodName param))

but this does not:

(. javaObj ((symbol "methodName") param))


I suppose this really comes down to the question: what is a symbol?
And, is the thing at the head of the list (+ 1 2 3) a symbol?

[In Icon, for example, there is no difference between

"funcName"(1,2,3) and funcName(1,2,3), or indeed:

x := "funcName"
x(1,2,3)

which is VERY useful.]

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