Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Scala classes in clojure

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 ^^

like image 243
Aymen Avatar asked Aug 24 '10 09:08

Aymen


2 Answers

Scala classes are Java classes and you can use Java classes from Clojure quite conveniently.

Have fun learning Clojure. :-)

like image 79
Michał Marczyk Avatar answered Nov 06 '22 12:11

Michał Marczyk


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.

like image 21
Daniel C. Sobral Avatar answered Nov 06 '22 13:11

Daniel C. Sobral