Base support for python objects and python->jvm interop. At this level (without interop), we can only support the copying protocols; we can't do bridging. Still, copying gets you quite far and you can, for instance, call python functions and get the attribute map from a python object.
Protocol functions implemented: python-type ->python ->jvm dir has-attr? attr callable? has-item? item set-item! do-call-fn len
Results of these, when they return python pointers, return the raw,unwrapped pointers. Callers at this level are sitting just close enough to the actual libpy calls to still get pointers back but they don't have to manage the gil.
Base support for python objects and python->jvm interop. At this level (without interop), we can only support the copying protocols; we can't do bridging. Still, copying gets you quite far and you can, for instance, call python functions and get the attribute map from a python object. Protocol functions implemented: python-type ->python ->jvm dir has-attr? attr callable? has-item? item set-item! do-call-fn len Results of these, when they return python pointers, return the raw,unwrapped pointers. Callers at this level are sitting just close enough to the actual libpy calls to still get pointers back *but* they don't have to manage the gil.
(->jvm item & [options])
Copy an object into the jvm (if it wasn't there already.)
Copy an object into the jvm (if it wasn't there already.)
(->py-fn fn-obj)
(->py-fn fn-obj
{:keys [method-name documentation py-self]
:or {method-name "unnamed_function" documentation "not documented"}})
Create a python callback from a clojure fn. If clojure fn, then tuple arguments are used. If keyword arguments are desired, the pass in something derived from: libpython-clj.jna.CFunction$KeyWordFunction. If a pure fn is passed in, arguments are marshalled from python if possible and then to-python in the case of successful execution. An exception will set the error indicator.
Create a python callback from a clojure fn. If clojure fn, then tuple arguments are used. If keyword arguments are desired, the pass in something derived from: libpython-clj.jna.CFunction$KeyWordFunction. If a pure fn is passed in, arguments are marshalled from python if possible and then to-python in the case of successful execution. An exception will set the error indicator.
(->python item & [options])
Completely convert a jvm object to a python copy.
Completely convert a jvm object to a python copy.
(apply-method-def-data! method-def {:keys [name doc function] :as method-data})
(incref-wrap-pyobject pyobj)
Increment the object's refcount and then call wrap-pyobject. Used for borrowed references that need to escape the current scope.
Increment the object's refcount and then call wrap-pyobject. Used for borrowed references that need to escape the current scope.
(python->jvm-iterable pyobj & [item-conversion-fn])
Create an iterable that auto-copies what it iterates completely into the jvm. It maintains a reference to the python object, however, so this method isn't necessarily safe.
Create an iterable that auto-copies what it iterates completely into the jvm. It maintains a reference to the python object, however, so this method isn't necessarily safe.
(python->jvm-iterator iter-fn item-conversion-fn)
This is a tough function to get right. The iterator could return nil as in you could have a list of python none types or something so you have to iterate till you get a StopIteration error.
This is a tough function to get right. The iterator could return nil as in you could have a list of python none types or something so you have to iterate till you get a StopIteration error.
(wrap-pyobject pyobj)
Wrap object such that when it is no longer accessible via the program decref is called. Used for new references. This is some of the meat of the issue, however, in that getting the two system's garbage collectors to play nice is kind of tough.
Wrap object such that when it is no longer accessible via the program decref is called. Used for new references. This is some of the meat of the issue, however, in that getting the two system's garbage collectors to play nice is kind of tough.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close