[V3dot10] Image before 0002788: Bug: Use of == for arithmetic equality problem

nicolas cellier ncellier at ifrance.com
Wed Oct 17 23:01:13 UTC 2007


Andreas Raab a écrit :
> nicolas cellier wrote:
>> Keep on doing good work Edgar.
>> That's a simple error of procedure. You cannot be your own reviewer.
>> Someone else has to do it.
>
> So who *has* reviewed the changes? Nobody? When was the last time that 
> changes to *hundreds* of methods have been introduced in the image 
> without any review whatsoever? I thought one of the goals of the 3.10 
> process was to improve code quality?
>
> Whatever. I only have to glance at Dan's snippet to tell you that 
> there will be plenty of situations where it will identify places that 
> would be completely wrong to change. You cannot take this and 
> automatically convert those comparisons. To give just one example, it 
> is commonplace to use loops like this:
>
>   obj := 0 someObject.
>   [0 == obj] whileFalse:[
>     "... do something ..."
>     obj := obj nextObject.
>   ].
>
> In my image alone there are 17 senders of #nextObject, *all* of which 
> exhibit this pattern. I'm certain there are other patterns like it.
>
>> Anyway, except ImageSegment, other zealous conversions should be 
>> harmless.
>> Questionnable, unneeded, but harmless.
>
> I can *guarantee* that this is assumption is wrong.
>
> Cheers,
>   - Andreas
> _______________________________________________
> V3dot10 mailing list
> V3dot10 at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/mailman/listinfo/v3dot10
>
>
Oh yes, very bad case! because the loop will exit on first 0.0 
encountered...
Quite same as ImageSegment bug.

What I called zealous was the non-arithmetic tests changed by side effect
(like == #someSymbol or == nil...)

I did not even notice some 0== or ==0 are not arithmetic...
Thanks!


More information about the V3dot10 mailing list