Using a cl_object in Lisp

Stewart M. sjm-mail at
Sat Jul 28 20:46:22 UTC 2018

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
    cl_object object;

  extern "C" cl_object getObject(LispObject* lo) { return lo->object; }
  extern "C" void setObject(LispObject* lo, cl_object clo) { lo->object = clo; }

The full code is:

Can I somehow declare the 'cl_object' type for the 'getValue()' and 'setValue()' functions using CFFI 'defcfun' to get and set ECL objects?  Is there a technique using the lower-level FFI?  I am looking for a way to do this without compiling C code embedded in Lisp, which I am aware ECL can do.

Thank you for any ideas!

Stewart Milberger
Kavalogic, Inc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the ecl-devel mailing list