<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
On 3/5/2020 9:46 PM, Hernan Wilkinson via Cuis-dev wrote:
<blockquote
cite="mid:CAJAbP8h-+ozHxNR3J5J3gav0CKHKB2u6T7as8LWrGd8mRYC20Q@mail.gmail.com"
type="cite">
<div dir="ltr">Hi,
<div> I just noticed that two methods that have the same source
code but are in different classes are considered equal...
there is a comment in the #= implementation that says that. </div>
<div> Why is that? what is the use case for that behavior?</div>
<div><br>
</div>
<div> I checked with Squeak and Pharo just for curiosity and
they are considered different...</div>
<div><br>
</div>
<div> Hernan.<br clear="all">
<div><br>
</div>
-- <br>
<div dir="ltr" class="gmail_signature"
data-smartmail="gmail_signature">
<div dir="ltr">
<div>
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div><span style="font-family:
tahoma,sans-serif; font-size:
xx-small; border-collapse:
collapse;"><strong><span
style="font-size: 8pt;"><span><span
style="font-size: small;"><font
size="2"><span
style="font-weight:
normal;"><span
style="font-weight:
bold;">Hernán
Wilkinson</span><br>
Agile Software
Development, Teaching
& Coaching</span></font></span></span></span></strong></span></div>
<div><span style="font-family:
tahoma,sans-serif; font-size:
xx-small; border-collapse:
collapse;"><strong><span
style="font-size: 8pt;"><span><span
style="font-size: small;"><font
size="2"><span
style="font-weight:
normal;">Phone: +54-011</span></font></span></span></span></strong></span><font
size="2" face="tahoma, sans-serif">-4893-2057</font></div>
<div><strong style="font-family:
tahoma,sans-serif; font-size:
xx-small;"><span style="font-size:
8pt;"><span style="font-size:
small;"><font size="2"><span
style="font-weight: normal;">Twitter:
@HernanWilkinson</span></font></span></span></strong></div>
<div><span style="font-family:
tahoma,sans-serif; font-size:
xx-small; border-collapse:
collapse;"><strong><span
style="font-size: 8pt;"><span><span
style="font-size: small;"><font
size="2"><span
style="font-weight:
normal;">site: <a
moz-do-not-send="true"
href="http://www.10pines.com/" style="color: rgb(17, 65, 112);"
target="_blank">http://www.10Pines.com</a></span></font></span></span></span></strong></span></div>
<div><font face="tahoma, sans-serif"><span
style="border-collapse: collapse;">Address:
Alem 896</span></font>, Floor 6,
Buenos Aires, Argentina</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
<br>
Hi Hernán,<br>
<br>
Maybe that was done in
2343-AvoidTestFailures-JuanVuletich-2015May27-15h25m-jmv.1.cs.st .
Maybe it was done before that. I don't remember.<br>
<br>
The commet at the method reads<br>
"#penultimateLiteral is selector (or properties, just compared,
above)<br>
Last literal is #methodClass.<br>
Don't compare them. Two methods might be equal even if they have
different selector (or none at all)<br>
or are installed in different classes (or none at all)"<br>
<br>
Maybe at the time it was done, behavior was consistent with Squeak.<br>
<br>
I tried changing it, by adding<br>
self penultimateLiteral = method penultimateLiteral ifFalse: [ ^
false ].<br>
self methodClass = method methodClass ifFalse: [ ^ false ].<br>
and it doesn't make any test fail.<br>
<br>
Maybe this behavior could be useful for a code rewrite tool, to
check that the generated code stays the same, without needing to
actually install the compiled method to be checked...<br>
<br>
Cheers,<br>
<pre class="moz-signature" cols="72">--
Juan Vuletich
<a class="moz-txt-link-abbreviated" href="http://www.cuis-smalltalk.org">www.cuis-smalltalk.org</a>
<a class="moz-txt-link-freetext" href="https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev">https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev</a>
<a class="moz-txt-link-freetext" href="https://github.com/jvuletich">https://github.com/jvuletich</a>
<a class="moz-txt-link-freetext" href="https://www.linkedin.com/in/juan-vuletich-75611b3">https://www.linkedin.com/in/juan-vuletich-75611b3</a>
@JuanVuletich</pre>
</body>
</html>