[Ecls-list] Collecting foreign data

Stanislav Frolov frolosofsky at gmail.com
Fri Jun 22 06:59:55 UTC 2012

Hi! I use ECL as an embed script for my application. I need to store a
foreign pointer and I would like to tell gc to collect it. Well, I can

cl_object cl_data = ecl_make_pointer(new my_type);
(some (lisp 'code (with cl_data)))

After that I can directly call back in C++ and delete cl_data:

cl_object my_type_delete(cl_object x){
 delete (my_type*)ecl_to_pointer(x);
 return Ct;}

But it is inconvenient in many cases. Is there a way to tell gc to
collect cl_data and to call my_type_delete when it is deleting the
holder of my pointer?

More information about the ecl-devel mailing list