Hello,
I have clojure code like:
(gen-class
:name SomeName
:extends SomeSuperClass)
(defn -clojure-fn [this]
(.f this 1)
(.f this string))
and in java there is SomeSuperClass class with overloaded methods, let's
say:
public void f(int a);
public void f(String a);
Is gen-class
or is it dynamically dispatched by JVM?
W dniu środa, 7 listopada 2012 23:43:20 UTC+1 użytkownik Bartosz Krupa
napisał:
Hello,
I have clojure code like:
(gen-class
:name SomeName
:extends SomeSuperClass)
(defn -clojure-fn [this]
(.f this 1)
(.f this string))
and in
Hi Bartek,
In this case, I don't think `gen-class` has any part to play at all. All
`gen-class` does is generate a class with stub methods that dispatch to
Clojure functions by name.
What matters is an expression like `(.f this a)`. If the Clojure compiler
can statically determine the types