Fork me on GitHub
#beginners
<
2016-10-17
>
dominicm08:10:25

@peter.d > Is it somehow similar to how the Integer wrapper-class works in Java? Exactly the same. That's what you're calling into there, using Java interop.

peter.d18:10:39

So you could say that in this case, Integer. works the same as Integer.parseInt(String s) ? If so, how does it know it's that exact method, and not any other on the Integer-class, like decode, getInteger, parseUnsignedInt etc? Sorry if this is a stupid question but I really want to understand. 🙂

tokenshift19:10:31

(which does exactly the same thing as Integer.parseInt)

tokenshift19:10:46

You could also call (Integer/parseInt “42”) for the latter.

tokenshift19:10:09

The (TypeName. foo) syntax is how you call Java constructors.

tokenshift19:10:16

(type name then ‘.’)

tokenshift19:10:54

http://clojure.org/reference/java_interop has all of the ways to call a Java method from Clojure, though you have to scroll down to get to the part that explains calling constructors.

neurogoo19:10:37

Hey, really really beginner question, but I have been reading about Clojure project structure and the relationship with namespaces and folder structure. Does something like Cider have any automatic way of helping you with this like adding namespaces to files based on where there are created etc.