[Ecls-list] new ECL list member/ ECL project

David Creelman dave at geko.net.au
Tue Jan 24 17:47:05 UTC 2006


Hi Michael,

Thanks for that. My app doesn't crash now.
How do you setup a gray stream ?

I'd love to be able to echo errors and general standard output goodness
to the screen.

In the FAQ, it points to xchat, but I couldn't find the implementation
of gray streams there.

Regards
David

On Tue, 2006-01-24 at 10:23 +0100, Goffioul Michael wrote:
> > Hi Dustin,
> > 
> > congratulations for you nice application. First of all, 
> > regarding the complaints some people had about the navigation 
> > panel, you can solve it by fixing the width in pixels of the 
> > text in the "body" element from the stylesheet.
> > 
> > As for your intro, it is quite well explained. There is one 
> > point you mention, which is input/output of data from the 
> > lisp code. You should know that input and output are by 
> > default directed to the stdin/stdout of your C program. 
> > Windows programs sometimes have these streams closed and 
> > therefore ECL will fail to produce output.
> > 
> > A simple fix is to redirect all interaction to a null stream:
> > 	(setf *terminal-io* (make-broadcast-stream))
> > 
> > More than a solution this can be characterized as a hack, 
> > because at some point your lisp will run on some error and it 
> > will need some interaction on your side.
> > 
> > If you do not want your program to be interactive, you can 
> > handle all errors using cl_safe_eval(). But if you want to 
> > allow for some responses from the user, you should then build 
> > Gray streams using something like Julian Stecklina's code in 
> > Xchat. At some point one should add a simple applet to 
> > examples/ showing how to do it.
> 
> This also a problem I had when embedding ECL into MATLAB under Windows.
> The problem is that in windows mode, standard streams are not defined
> and
> it made MATLAB crashes when ECL tried to print on stdout. To work around
> the problem, I used a 2-steps process:
> 1) at very early stage (just after cl_boot), I redefine *terminal-io*
> and
> *error-output* to dummy streams (I use string-streams)
> 2) after everything is setup correctly, I redefines those 2 streams
> using
> application-defined gray streams that allow the ECL output to be
> redirected
> to MATLAB window
> The step 1 was needed because if anything went wrong during the
> initialization
> (even a simple warning message) and before the correct redefinition
> using
> gray streams, it made the whole app to crash. Using string-streams in
> step 1
> also allow to catch the ECL output during initialization.
> 
> Michael.
> 
> 
> -------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
> for problems?  Stop!  Download the new AJAX search engine that makes
> searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
> http://sel.as-us.falkag.net/sel?cmd_______________________________________________
> Ecls-list mailing list
> Ecls-list at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ecls-list
> 
-- 
David Creelman
GPG: 11CC 0D54 D37A 4B9C 5C65  AB63 5B18 7F99 7D77 9CA5




More information about the ecl-devel mailing list