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

Levente Uzonyi leves at elte.hu
Tue Nov 16 05:46:54 UTC 2010


On Mon, 15 Nov 2010, Andreas Raab wrote:

> 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)

Originally here: 
http://lists.squeakfoundation.org/pipermail/squeak-dev/2006-February/100600.html
. The mantis issue is here: http://bugs.squeak.org/view.php?id=2788 .


Levente

>
> 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