[Ecls-list] Calling "load" from si_safe_eval

Juan Jose Garcia-Ripoll juanjose.garciaripoll at googlemail.com
Mon Jul 13 08:04:44 UTC 2009


On Mon, Jul 13, 2009 at 6:07 AM, Greg Santucci<thecodewitch at gmail.com> wrote:
> I have embedded ECL into my C++ simulation, and I'd like to be able to call
> "load" from the si_safe_eval function.
> When I try the following, the error symbol is returned:
>
> cl_object form = c_string_to_object("(load \"test.lsp\"");
> cl_object result = si_safe_eval(3, form, Cnil, g_evalErrorSymbol);

Be creative

cl_object form = c_string_to_object("
(handler-case (load \"test.lsp\")
   (error (c) (princ c) (print c)))
");

or if you want to debug it

cl_object form = c_string_to_object("
(handler-case (load \"test.lsp\")
   (error (c) (invoke-debugger c)))
");


-- 
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