[squeak-dev] Re: Using #= for integer comparison instead of #==

Andreas Raab andreas.raab at gmx.de
Tue Nov 16 05:34:13 UTC 2010


If I may ask, what is the advantage of changing integer comparisons from 
#== to #=? (I might have missed the discussion leading up to it; if 
there was one just point me to it)

Cheers,
   - Andreas

On 11/15/2010 9:00 PM, Levente Uzonyi wrote:
> Hi,
>
> I'm mostly ready with this cleanup, only a few methods left in the image
> that use #== for integer comparison. Some of them must use #==, others
> may be changed, but I wasn't sure if the code will work if it's changed
> or not. If you'd like to check these methods, then evaluate the
> following in a workspace:
>
> | hasMatch visitor |
> hasMatch := false.
> visitor := ParseNodeEnumerator
> ofBlock: [ :node |
> (node isMessageNode and: [
> ((#(== ~~) identityIncludes: node selector key) and: [
> node receiver isConstantNumber or: [
> node arguments first isConstantNumber ] ]) ]) ifTrue: [
> hasMatch := true ] ]
> select: [ :node | hasMatch not ].
> SystemNavigation default browseAllSelect: [ :method |
> hasMatch := false.
> method decompile accept: visitor.
> hasMatch ]
>
>
> Cheers,
> Levente
>
>




More information about the Squeak-dev mailing list