File tree Expand file tree Collapse file tree 1 file changed +10
-12
lines changed
Expand file tree Collapse file tree 1 file changed +10
-12
lines changed Original file line number Diff line number Diff line change 3636 and the others are objects to import from this library"
3737 ([] nil )
3838 ([lib] ; import a library
39- `(do (. clojure-python.core/interp exec (str " import " ~(name lib)))
40- (def ~lib (. (. (. clojure-python.core/interp getLocals)
41- __getitem__ ~(name lib))
42- __dict__))
39+ `(do (.exec *interp* (str " import " ~(name lib)))
40+ (def ~lib
41+ (-> *interp*
42+ .getLocals
43+ (.__getitem__ ~(name lib))
44+ .__dict__))
4345 (print ~lib)))
4446 ([lib object] ; import object from a library
45- `(do (def ~object (.__finditem__
46- ~lib
47- ~(name object)))
47+ `(do (def ~object (.__finditem__ ~lib ~(name object)))
4848 (print ~object)))
4949 ([lib object & more-objects] ; import multiple objects
5050 `(do (py-import ~lib ~object)
103103 " access 'PyObjectDerived' items as Lazy Seq"
104104 [pyobj] (lazy-seq (.__iter__ pyobj)))
105105
106- (defn java2py
107- " to wrap java objects for input as jython, and unwrap
108- Jython output as java (thanks to Marc Downie on Clojure
109- list for suggesting this)"
106+ (defn- java2py
107+ " to wrap java objects for input as jython, and unwrap Jython output as java"
110108 [args]
111109 (into-array
112110 org.python.core.PyObject
113111 (map
114112 (fn [n] (. org.python.core.Py java2py n))
115113 args)))
116114
117- (defn call
115+ (defn- call
118116 " The first len(args)-len(keywords) members of args[]
119117 are plain arguments. The last len(keywords) arguments
120118 are the values of the keyword arguments."
You can’t perform that action at this time.
0 commit comments