3

Is it possible to run clojure in kotlin? More specific in spring?

I have made scrapers in clojure and I want to use them on a web application written in kotlin. How does that look like in kotlin? The code..

1 Answers1

6

I would suggest using the clojure.java.api.Clojure class, as documented in the Java interop section of Clojure reference documentation under the heading Calling Clojure From Java.

A Java example:

import clojure.java.api.Clojure;
import clojure.lang.IFn;

// this part taken from the reference page linked above:
IFn plus = Clojure.var("clojure.core", "+");
plus.invoke(1, 2);
Michał Marczyk
  • 83,634
  • 13
  • 201
  • 212