[squeak-dev] The Inbox: Collections-EG.908.mcz

Eric Gade eric.gade at gmail.com
Sat Aug 8 03:32:32 UTC 2020


Hi Dave,

On Fri, Aug 7, 2020 at 10:14 PM David T. Lewis <lewis at mail.msen.com> wrote:

> Actually, I think that the new ReadStreamTest>>testPeekBack is not in
> agreement with the existing RWBinaryOrTextSteamTest>>testPeekBack.
>

Looks like I got too excited and neglected to run the full test suite,
apologies!


> If I understand correctly, peek means "show me the next element that
> has not yet been read from the stream", and peekBack means "show me the
> element before the one that was most recently read from the stream".
> So I expect that peekBack would mean to skip back 2 from the current
> position, not skip back 1.
>

I see what you are saying and that makes sense to me. My thinking was that
stream positions are always "between" the elements, and that a "peek
forward" just means "grab the element but don't advance the position. In
that case, peeking backward would do the same in the reverse direction:
look one element back but not decrement the position.

Because there are no senders I guess this isn't a big deal and we can trash
the changes. It came up because I'm thinking of porting my refactor of
GIFReadWriter and animated image parsing that I did for Pharo about a year
ago. I use peekBack in a couple of places there but can definitely figure
out another way to achieve the same result. (I'll save the GIF discussion
for a later email because it's ... complicated).

Thanks!


>
> Dave
>
-- 
Eric
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20200807/865a6050/attachment.html>


More information about the Squeak-dev mailing list