Re: About ~= and ~~
Posted by
Levente Uzonyi-2 on
Oct 12, 2011; 3:38pm
URL: https://forum.world.st/About-and-tp3898409p3898440.html
On Wed, 12 Oct 2011, Clara Allende wrote:
> Hi guys,
>
> I'm wondering, why?
>
> ProtoObject>> ~~ anObject
> "Answer whether the receiver and the argument are not the same object
> (do not have the same object pointer)."
>
> self == anObject
> ifTrue: [^ false]
> ifFalse: [^ true]
>
> Instead of:
> ProtoObject>> ~~ anObject
> "Answer whether the receiver and the argument are not the same object
> (do not have the same object pointer)."
>
> ^(self == anObject) not
>
> And why?
> Object >> ~= anObject
> "Answer whether the receiver and the argument do not represent the
> same object."
>
> ^self = anObject == false
>
> Instead of
> Object>> ~= anObject
> "Answer whether the receiver and the argument do not represent the
> same object."
>
> ^(self = anObject) not.
>
> Is there any particular reason for this that I'm missing?
Performance.
Levente
> Thanks in advance!
> --
>
> "*Most good programmers do programming not because they expect to get paid
> or get adulation by the public, but because it is fun to program.*"
>
> Linus Torvalds
>