[Ecls-list] Restarting the ECL engine within the same process?
Goffioul Michael
goffioul at imec.be
Fri Oct 1 04:37:01 UTC 2004
Hi,
I discovered ECL and found it very interesting for our internal
purpose, which is to embed a LISP engine within a MEX file for
MATLAB. I didn't try it completely yet, but I have a question
regarding the possibility to restart the ECL engine within the
same process.
I wrote the little test program:
====================
#include <ecl.h>
#include <stdio.h>
int main( int argc, char **argv )
{
· cl_object s1;
· char* my_args[ 1 ] = { "ecl" };
· cl_boot( 1, my_args );
· s1 = make_simple_string( "~&This is my string." );
· cl_format( 2, Ct, s1 );
· cl_shutdown();
· printf( "I'm here!!\n" );
· argv[ 0 ] = "ecl";
· cl_boot( 1, my_args );
· s1 = make_simple_string( "~&This is my other string." );
· cl_format( 2, Ct, s1 );
· cl_shutdown();
· return 0;
}
====================
The problem is that this creates a segmentation fault when booting
for the second time, which is detected by ECL and I'm redirected
to the debugger.
Is there a way to cleanly shutdown and restart the LISP engine?
Note: this is what would happen for an embedded ECL into a MEX file
when the MEX file is cleared and reloaded in the MATLAB session.
Thanks.
Michael.
More information about the ecl-devel
mailing list