[squeak-dev] CompiledMethod >> #=

tim Rowledge tim at rowledge.org
Mon Jan 10 18:22:47 UTC 2022


Would renaming that to something like #semanticallySimilarTo: make it clearer?

> On 2022-01-10, at 9:24 AM, Eliot Miranda <eliot.miranda at gmail.com> wrote:
> 
> 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
> 


tim
--
tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
42.7 percent of all statistics are made up on the spot.




More information about the Squeak-dev mailing list