On Jan 26, 2008 1:10 AM, Joel Reymont <[EMAIL PROTECTED]> wrote:
> I would like to both print debugging information to stdio and take
> advantage of with-stream to ensure my files are closed in the event of
> an error. It doesn't look like I can accomplish my goals at the moment.
You can accomplish your goals by writing some helper words to save the
old stdio, and use it to log. See log-message, with-log-stream, etc in
io.server for examples. eg:
stdio get [
myfile <file-reader-writer-whatever> [
"foo" . #! writes to file
"foo" log-message #! writes to stdio
[ "foo" . ..blahblah.. ] string-out log-message #! more complex stdio output
] with-stream
] with-log-stream
Chris.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Factor-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/factor-talk