Peter Enerccio <[email protected]>
writes:

> I am looking for easy way of wrapping around class instances of c++.
> I can wrap it in lisp with classes with slot containing fixnum of the
> pointer and then recast it in c++ but its cumberstone and has lot of
> boiler plate on both lisp and c++ side. Any other way of doing that?
> Could be even in lisp altogether, because then I could generate c
> code out of it or something.

If you compile ecl with the same C++ compiler as your C++ code, then you
can use the FFI:C-INLINE macro along with the rest of the FFI to
interface between your lisp code and your C++ code.


Otherwise, I would write a C wrapper over C++ classes, and use CFFI to
interface to that wrapper (you can use swig to generate the CFFI API on
the C wrapper).

You can even try to apply swig on C++ code, but it is only able to
generate the C wrapper automatically in the simpliests of the cases.
C++ code often seems designed to prevent FFI!


-- 
__Pascal Bourguignon__                     http://www.informatimago.com/
A bad day in () is better than a good day in {}.


------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
Ecls-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ecls-list

Reply via email to