<br>Unfortunately, to enjoy the benefit of that, I need to redirect the terminal io, which I am also having trouble with. Based on the example of eclgui, I am attempting it this way:<br><br>cl_def_c_function(cl_intern(1, make_simple_base_string("%TERM-IO-WRITE-CHAR%"")), (void *)termIOWriteChar, 1);<br>
cl_def_c_function(cl_intern(1, make_simple_base_string("%TERM-IO-FLUSH%")), (void *)termIOFlush, 0);<br><br>(The following is executed with si_safe_eval - I omit my wrapper for clarity, and show you the output in the repl I have in my app)<br>
<br>(defclass %term-io% (gray:fundamental-character-output-stream) (last-char))<br>#<The STANDARD-CLASS %TERM-IO%>
<p style="margin: 0px; text-indent: 0px;"><br></p>(defmethod gray:stream-write-char ((stream %term-io%) c) ( %TERM-IO-WRITE-CHAR% c))<br>#<STANDARD-METHOD STREAM-WRITE-CHAR (#<The STANDARD-CLASS %TERM-IO%>
<p style="margin: 0px; text-indent: 0px;"> #<The BUILT-IN-CLASS T>)></p><br>(defmethod gray:stream-force-output ((stream %term-io%)) ( %TERM-IO-FLUSH% ) t)<br><p style="margin: 0px; text-indent: 0px;">
#<STANDARD-METHOD STREAM-FORCE-OUTPUT (#<The STANDARD-CLASS %TERM-IO%>)> </p><p style="margin: 0px; text-indent: 0px;"><br></p>(setq *terminal-io* (make-two-way-stream (make-string-input-stream \"\") (make-instance '%term-io%)))<br>
<p style="margin: 0px; text-indent: 0px;">#<two-way stream 0a04b320></p>
<p style="margin: 0px; text-indent: 0px;"><br></p>(setq *error-output* (two-way-stream-output-stream *terminal-io*))<br><p style="margin: 0px; text-indent: 0px;">#<a %TERM-IO%></p>
<p style="margin: 0px; text-indent: 0px;"><br>
</p>
I'm expecting the function termIOWriteChar and termIOFlush to be called - they are not.<br><br><br><br><br><div class="gmail_quote">On Mon, Jul 13, 2009 at 6:04 PM, Juan Jose Garcia-Ripoll <span dir="ltr"><<a href="mailto:juanjose.garciaripoll@googlemail.com">juanjose.garciaripoll@googlemail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div class="h5">On Mon, Jul 13, 2009 at 6:07 AM, Greg Santucci<<a href="mailto:thecodewitch@gmail.com">thecodewitch@gmail.com</a>> wrote:<br>
> I have embedded ECL into my C++ simulation, and I'd like to be able to call<br>
> "load" from the si_safe_eval function.<br>
> When I try the following, the error symbol is returned:<br>
><br>
> cl_object form = c_string_to_object("(load \"test.lsp\"");<br>
> cl_object result = si_safe_eval(3, form, Cnil, g_evalErrorSymbol);<br>
<br>
</div></div>Be creative<br>
<div class="im"><br>
cl_object form = c_string_to_object("<br>
</div>(handler-case (load \"test.lsp\")<br>
(error (c) (princ c) (print c)))<br>
");<br>
<br>
or if you want to debug it<br>
<div class="im"><br>
cl_object form = c_string_to_object("<br>
</div>(handler-case (load \"test.lsp\")<br>
(error (c) (invoke-debugger c)))<br>
");<br>
<font color="#888888"><br>
<br>
--<br>
Instituto de Física Fundamental, CSIC<br>
c/ Serrano, 113b, Madrid 28006 (Spain)<br>
<a href="http://juanjose.garciaripoll.googlepages.com" target="_blank">http://juanjose.garciaripoll.googlepages.com</a><br>
</font></blockquote></div><br>