[V3dot10] Re: Re: 0006583: PositionableStream>>back behavior is totallywrong

Klaus D. Witzel klaus.witzel at cobss.com
Wed Aug 1 16:35:45 UTC 2007


On Wed, 01 Aug 2007 17:22:34 +0200, Ron Teitelbaum wrote:
> Klaus,
>
> I was just reading Damien's new code and even though the current
> implementation does position correctly it returns the wrong value.   
> Damien's
> code returns the proper back value and replaces #next with #peek, to  
> leave
> the position in the right place.
>
> It's a good change.  Not sure I support leaving #oldBack for long though.
> There doesn't appear to be much use of getting a returned result 2  
> positions
> back from a call to oldBack.

Ron, the invariant I wrote does not care about the return value. If  
Damien's change keeps that behavior (indeed I'm convinced that Damien will  
do so) then chances are that nobody really used the mistaken return value.  
The users of #back in 3.9/10 and 3.8 do discard the value, AFAICT.

I agree with you, remove #oldBack. Whoever would change his code to use  
make use of #oldBack, can equally well put in the correct use.

/Klaus

> Ron Teitelbaum
>
>> -----Original Message-----
>> From:  
>> v3dot10-bounces-bD51WKytQuJI8mQ4nJOOf3xJsTq8ys+cHZ5vskTnxNA at public.gmane.org  
>> [mailto:v3dot10-
>> bounces at lists.squeakfoundation.org]  
>> On Behalf Of Klaus D. Witzel
>>
>> Hi Damien,
>>
>> an actual user of #back is #asSignedInteger, from which I derived the
>> following invariant:
>>
>>   aStream position == (aStream next; back; position)
>>
>> So #back can't be that wrong, no?
>>
>> /Klaus
>>
>> From: "Damien Cassou"
>> Newsgroups: gmane.comp.lang.smalltalk.squeak.v3dot10
>> Subject: 0006583: PositionableStream>>back behavior is totally wrong
>> Date: Wed, 01 Aug 2007 16:47:27 +0200
>> URL:  
>> news://<6ac749c10708010747h421fac8fq52a56aad37a0e7f1-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
>>
>> http://bugs.squeak.org/view.php?id=6583
>>
>>
>> _______________________________________________
>> V3dot10 mailing list
>> V3dot10 at lists.squeakfoundation.org
>> http://lists.squeakfoundation.org/mailman/listinfo/v3dot10




More information about the V3dot10 mailing list