String printcode = "(print "foo")";
If I have the above String in java, is there anyway to execute it by clojure inside the Java ?
String printcode = "(print "foo")";
If I have the above String in java, is there anyway to execute it by clojure inside the Java ?
The following should work (assuming that you have properly set up dependencies and initialised the Clojure runtime):
import clojure.lang.RT;
import clojure.lang.Compiler;
...
Compiler.eval(RT.readString("(print \"foo\")")));