libpython-clj2.embedded

Tools for embedding clojure into a python host process. See jbridge.py for python details. This namespace relies on the classpath having nrepl and cider-nrepl on it. For example:

clojure -SPath '{:deps {nrepl/nrepl {:mvn/version "0.8.3"} cider/cider-nrepl {:mvn/version "0.25.5"}}}' ...

initialize!

(initialize!)(initialize! libpath)

Initialize python when this library is being called from a python program. In that case, unless libpath is explicitly provided the system will look for the python symbols in the current executable.

start-repl!

(start-repl! options)(start-repl!)

This is called to start a clojure repl and block the thread. This function does not return control to the calling thread until another thread calls `stop-repl!; this design is explicit to ensure the python GIL is released and thus when connected to the REPL you can use Python.

If an existing repl server has been started this returns the port of the previous server else it returns the port of the new server.

To return control to the calling thread call stop-repl!.

Options are the same as the command line options found in nrepl.cmdline.

stop-repl!

(stop-repl!)

If an existing repl has been started, stop it. This returns control to the thread that called start-repl!.