Quantcast
Channel: How do I pass a static method to comp in clojure? - Stack Overflow
Viewing all articles
Browse latest Browse all 3

How do I pass a static method to comp in clojure?

$
0
0

It seems as though I'm having problems accessing Integer.parseInt in comp. I can access it normally like this:

user=> (Integer/parseInt "123")123

But if I put it in comp, I get an error:

user=> (def vect-to-int (comp Integer/parseInt (partial apply str)))java.lang.Exception: Unable to find static field: parseInt in class java.lang.Integer (NO_SOURCE_FILE:3)

It sounds to me like it's trying to find a field on Integer when it should be looking for a method. How can I use Integer.parseInt like this? And is there a better way to convert a vector of chars into an int?


Viewing all articles
Browse latest Browse all 3

Latest Images

Trending Articles





Latest Images