> A more radical idea is to remove duplex streams altogether. Instead,
> words like <process-stream> and <client> would return a pair of
> streams, a reader and a writer. A with-streams combinator with stack
> effect ( in out quot -- ) could be used here.

OK. But then let's look at one of the reasons you want to do away with 
duplex-stream:

> - Implementations of things like setting the timeout, changing the  
> encoding is ugly with duplex streams.

If <process-stream> retuns two streams, you will have to set the timeout 
twice; you will have to change the encoding twice. The "ugly" is being 
shifted somewhere else.

Moreover, it's being shifted from a place where it was an abstrated pattern, 
into every place where a timeout/encoding is changed. This seems 
like "unfactoring".

Alternatively, let's say you wait until you're inside the "with-streams" 
quotation to modify the timeout or encoding. If you want to change the 
encoding, you'll have to do so on 'input' and '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

Reply via email to