[Ecls-list] Arrays to C and C to Arrays....

Juan Jose Garcia-Ripoll juanjose.garciaripoll at googlemail.com
Sun Nov 8 11:56:50 UTC 2009


On Sun, Nov 8, 2009 at 4:52 AM, Brad Beer <bradwbeer at gmail.com> wrote:
> How can I convert C arrays to Lisp Arrays and vice-versa using only the FFI?

You mean without copying data? That is not supported because your FFI
data might not be even created by the garbage collector at all. The
converse, extracting the pointer from a lisp array, is plain easy: use
c-inline. But again: you have to keep a valid reference to the lisp
array object (not data) somewhere.

> The ability to pass pointers back and forth would be good too.

http://ecls.sourceforge.net/new-manual/ch18.html
http://ecls.sourceforge.net/new-manual/pt04.html

Samium already pointed to a different FFI, namely the CFFI library
which may be more advanced.

> Finally, is
> there a way to pass cleanup to Lisp from a c-inline block? Thanks!

Meesa not understand what "pass cleanup" means :-)

Juanjo

-- 
Instituto de Física Fundamental, CSIC
c/ Serrano, 113b, Madrid 28006 (Spain)
http://juanjose.garciaripoll.googlepages.com




More information about the ecl-devel mailing list