Embedding swank-clojure in java program

Posted by user237417 on Stack Overflow See other posts from Stack Overflow or by user237417
Published on 2010-04-18T03:32:44Z Indexed on 2010/04/18 3:43 UTC
Read the original article Hit count: 468

Filed under:
|
|

Based on the Embedding section of http://github.com/technomancy/swank-clojure, I'm using the following to test it out. Is there a better way to do this that doesn't use Compiler? Is there a way to programmatically stop swank? It seems start-repl takes control of the thread. What would be a good way to spawn off another thread for it and be able to kill that thread programatically.

import clojure.lang.Compiler; import java.io.StringReader;

public class Embed { public static void main(String[] args) throws Exception { final String startSwankScript = "(ns my-app\n" + " (:use [swank.swank :as swank]))\n" + "(swank/start-repl) "; Compiler.load(new StringReader(startSwankScript)); } }

Any help much appreciated, hhh

© Stack Overflow or respective owner

Related posts about swank

Related posts about clojure