Hi everyone. Ran into an interesting case here when trying stuff out
in the REPL.
user=> (Math/sqrt 4)
2.0
user=> (map #(Math/sqrt %) (range 1 10))
(1.0 1.4142135623730951 ......)
user=> (map Math/sqrt (range 1 10))
java.lang.Exception: Unable to find static field: sqrt in class
java.lang.Math (NO_SOURCE_FILE: 2)
Shouldn't it be possible to apply Math/sqrt directly? If I use a
function from the clojure.core, I can do it:
user=> (map str (range 1 10))
("1" "2" "3" "4" "5" "6" "7" "8" "9")
What am I missing? Thanks.
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en