Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

clojure and scala interop

Tags:

scala

clojure

I am familiar that scala classes / objects can be called from clojure, as scala compiles to bytecode, and clojure is comfortable with it.

However is it as painless calling clojure functions, and importing namespaces from scala ?

I would like to mix the excellent lift framework and clojure, basically call clojure code from lift.

like image 599
murtaza52 Avatar asked Aug 13 '12 06:08

murtaza52


1 Answers

Semantics for imports in Scala are basically the same as Java. You should be able to get the info you need by reading up on how to invoke Clojure code from Java, then apply the same principles in Scala.

If you want to compile your Clojure code and include it as a JAR in your classpath then this post should be relevant:

Calling Clojure from Java

If you'd rather dynamically compile/interpret the .clj files then you should read this:

Clojure Programming: Invoking Clojure from Java

The first option seems a lot nicer to me.

like image 164
DaoWen Avatar answered Sep 19 '22 05:09

DaoWen