Bulat Ziganshin wrote:

Tuesday, February 21, 2006, 4:05:57 PM, you wrote:


i'm not very interested to do something fascinating in this area. it
seems that it is enough to do

1) non-blocking read of the entire buffer on input
2) flush buffer at each '\n' at output

that should be enough to implement LineBuffering for everyone except
purists? and for the NoBuffering the same except for flushing after
each output operation?


SM> Yes, exactly. This is almost what GHC's System.IO currently does, SM> except that for NoBuffering we have a fixed buffer size of 1 byte. It
SM> would be safe to have a larger buffer size for NoBuffering read handles,
SM> but I didn't recognise that when I wrote it.

btw, this makes NoBuffering mode unusable for some tasks. Donn Cave
wrote about this here:

Someone is confused here, probably me. Could you elaborate on what you're referring to by "this", and "unusable for some tasks"?

Cheers,
        Simon
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to