Slava Pestov wrote:
> Because its not general enough. Only works for input from a file and
> output from a file.
I agree. When I was thinking about with-reader-writer, I also thought about
having with-input-output.
: with-input-output ( stream stream quot -- ) ... ;
If you pass 'f' as a stream, it uses stdio for that stream.
> You might want input from a file and output to a process stream, input
> from a socket and output to the console, etc.
Those are covered by with-input-output (again, with the utf8 defaults) :
"in.txt" { "wc" } <process-stream> [ ... ] with-input-output
"www.apple.com" "http" <inet> <client> f [ ... ] with-input-output
Ed
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Factor-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/factor-talk