[BUG][Comanche] BufferStream>>upTo:

Avi Bryant avi at beta4.com
Fri Dec 13 07:47:06 UTC 2002


Something I just ran into that I thought I'd point out, particularly to
those (Michael?  Stephen?) that are working on the Comanche code:

PositionableStream implements #upTo: so that it consumes the delimeter,
ie,

s := 'abcd' readStream.
s upTo: $c.
s next "=> $d'.

However, BufferStream (which is used by SocketStream) implements it so
that it leaves the delimeter in the stream, and #next will return it.

This makes it pretty hard to write code that will work with both files and
sockets, for example.

The only Comanche methods that actually seem to use SocketStream>>upTo:
are SocketStream>>nextLine and #nextLineCr, both of which are trivially
adapted.  However, there may be other client code depending on the broken
behavior, so I won't post a fix - I'd just like any rewrite not to copy
the mistake.

Avi




More information about the Squeak-dev mailing list