Hello Marius,
This was very helpful, thank you!
> Hi Stewart,
>
> cl_object's are declared as :object type in ECL's ffi, so
>
> (ffi:def-function "getObject" ((lo :pointer-void)) :returning :object)
> (ffi:def-function "setObject" ((lo :pointer-void) (clo :object)))
>
> should work. CFF
I found a link to a similar question:
https://stackoverflow.com/questions/44494613/embeddable-common-lisp-ecl-load-shared-library-with-extension-functions
I was looking for a more direct way.
--
Stewart Milberger
Kavalogic, Inc.
Hi Stewart,
cl_object's are declared as :object type in ECL's ffi, so
(ffi:def-function "getObject" ((lo :pointer-void)) :returning :object)
(ffi:def-function "setObject" ((lo :pointer-void) (clo :object)))
should work. CFFI does not support this as far as i know.
Hope that helps,
Mari
To clarify, the issue is not with C++, which I am successfully wrapping with C.
The actual issue is using the c_object type in Lisp--if it comes back as a CFFI
pointer, how can I use it in Lisp as a Lisp object? Is there something like:
(ffi:pointer-to-lisp-object ptr)
--
Stewart Milberger
K
I am using CFFI with ECL to interface to a C++ library, which has a C++ class
with a data member of type 'cl_object'. Simplified, my C++ code is:
class LispObject
{
public:
cl_object object;
};
extern "C" cl_object getObject(LispObject* lo) { return lo->object; }
extern "C" void