Hi
It's just a stupid question that I had this morning : Can we use Scala classes from clojure ?
Because if the answer is yes, I'll definetly learn Clojure ^^
Hi
It's just a stupid question that I had this morning : Can we use Scala classes from clojure ?
Because if the answer is yes, I'll definetly learn Clojure ^^
Scala classes are Java classes and you can use Java classes from Clojure quite conveniently.
Have fun learning Clojure. :-)
Scala classes, yes. Scala singleton objects, with the same year signature as from Java. Scala traits, no. Scala implicits, hah, you jest!
So the experience may range from "ok", if it's just your classes, to very disagreeable, in the case of Scala collections, for instance.
Worth saying that Scala classes which take function parameters, such as:
Option.map(f : A => B)
Are unlikely to be very useable from Clojure, because the Clojure compiler will not turn Clojure lambdas into instances of scala.FunctionN
. I'm with Daniel - I think interop will be poor.