[squeak-dev] Can we change the meaning of peekBack?

Nicolas Cellier nicolas.cellier.aka.nice at gmail.com
Mon Jul 28 15:02:03 UTC 2014


Hi, I need to retrieve the last object put on a Stream (well SmartRefStream
does).
This is very much like #ensureEndsWith:

There is back, but back leave the stream positionned before the last object.

((ReadWriteStream on: String new) nextPutAll: 'abc'; back) -> $c
((ReadWriteStream on: String new) nextPutAll: 'abc'; back; position) -> 2.

There is peekBack, but peekBack answers the last but one...

((ReadWriteStream on: String new) nextPutAll: 'abc'; peekBack) -> $b.
((ReadWriteStream on: String new) nextPutAll: 'abc'; peekBack; position) ->
3.

Note that neither back nor peekBack is understood by a WriteStream.
It requires a ReadWriteStream.

Since peekBack is the sole sender of oldBack in trunk, I wonder who is
using it?
I ask because I'd like to change the meaning of peekBack to that of back
instead of oldBack.
Unless you have a better selector to propose?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20140728/2a81164a/attachment.htm


More information about the Squeak-dev mailing list