[Ecls-list] c++ and objects
Juan Jose Garcia-Ripoll
juanjose.garciaripoll at googlemail.com
Sun Jun 18 08:05:52 UTC 2006
There are two options for what you want. First, you can build ECL with
a c++ compiler. This will allow you to access C++ functions from
inline code without name mangling problems.
As for the data, lisp does not understand C++ objects, but it knows
about C structures, pointers, arrays, etc. The solution is thus to
encapsulate C++ objects in pointers and pass them around.
Next you have to create lisp functions to access slots on these
objects and invoke their "methods". This can be done by hand, inlining
C++ code in your program, or with some automatic generator of lisp/C
code. I only know of two projects which handle C/C++, they are the
swig and the fetter projects. They have different backends. I suspect
fetter goes with cffi, but I heard that swig can produce uffi code.
Both should run with ECL, though they might have to be modified.
Regards,
Juanjo
2006/6/15, Knut Olav Bøhmer <bohmer at gmail.com>:
> HI,
>
> How can I call c++ functions from ecl, and how can coonvert c++
> objects into clos objects?
>
> --
> Knut Olav Bøhmer
More information about the ecl-devel
mailing list