If i want to call java methodes or fields in clojure i can use the dot special form, since clojure strings are implemented as java strings i think i should be able to call the String methodes of java by something like (.toUpperCase "clojure") which works. My question is why can i not access to all of the java Methods in the same manner? For example (.valueOf 3) which is this static method gives me an error.
asked Sep 29, 2015 at 9:48
user4813927
-
possible duplicate of How can I call a java static method in clojure?Viktor K.– Viktor K.2015年09月29日 10:15:53 +00:00Commented Sep 29, 2015 at 10:15
1 Answer 1
Is's a static method, so also in java you would call String.valueOf(3):
user=> (String/valueOf 3)
"3"
answered Sep 29, 2015 at 10:07
cfrick
37.3k7 gold badges62 silver badges77 bronze badges
Sign up to request clarification or add additional context in comments.
Comments
default