[squeak-dev] CompiledMethod >> #=

Eliot Miranda eliot.miranda at gmail.com
Mon Jan 10 17:24:17 UTC 2022


Hi Christoph,

> On Jan 10, 2022, at 6:31 AM, Thiede, Christoph <Christoph.Thiede at student.hpi.uni-potsdam.de> wrote:
> 
> 
> Hi all,
> 
> 
> 
> currently, the comparison of CompiledMethods does not honor their selector, e.g.:
> 
> 
> 
> Object >>  bar: arg
> 
> ^ arg * 2
> 
> Object >>  foo: arg
> 
> ^ arg * 2
> 
> (Object >> #foo:) = (Object >> #bar:) will answer true.
> 
> Is this intended behavior or rather a slip?

Intended.  The method is defined to compare a method’s effects and state (pragmas, properties).

> I find this especially confusing as it the CompiledCodeInspector, you can see a difference in the literals of both methods, but nevertheless, #hasSameLiteralsAs: answers

Ok but I want to know what a method’s semantics are when I ask for equality (at least that was what I was interested in when I defined it). The selector and methodClass arguably don’t have a bearing on this.

> true.

The selector and methodClass are stored as literals but not referenced as literals (although methodClass is part of super sends).

> 
> Best,
> Christoph
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20220110/3e87b7e3/attachment.html>


More information about the Squeak-dev mailing list