Skip to content

Commit

Permalink
make ! convention more correct
Browse files Browse the repository at this point in the history
  • Loading branch information
rplevy committed Dec 14, 2011
1 parent 6dc42ab commit ff6ef14
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/clojure_python/core.clj
Expand Up @@ -13,20 +13,21 @@
*interp*)

(defn init
"Establish a global python interpreter. it is intended to only be called
once. Alternatively, only use with-interpreter."
"Establish a global python interpreter.
The init function is only usefully called once.
Alternatively, only use with-interpreter."
[{:keys [libpaths] :as options}]
(defonce ^:dynamic
^{:doc "root binding serves as global python interpreter"}
*interp*
(org.python.util.PythonInterpreter.))
(append-paths! libpaths))
(append-paths libpaths))

(defmacro with-interpreter
"Dynamically bind a new python interpreter for the calling context."
[{:keys [libpaths] :as options} & body]
`(binding [*interp* (org.python.util.PythonInterpreter.)]
(append-paths! ~libpaths)
(append-paths ~libpaths)
~@body))

(defmacro py-import
Expand Down

0 comments on commit ff6ef14

Please sign in to comment.