<div dir="ltr"><div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Thu, Nov 15, 2018 at 5:36 PM Eliot Miranda <<a href="mailto:eliot.miranda@gmail.com" target="_blank">eliot.miranda@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr">Hi Bert,<br><br><div class="gmail_quote"><div dir="ltr">On Thu, Nov 15, 2018 at 4:38 PM Bert Freudenberg <<a href="mailto:bert@freudenbergs.de" target="_blank">bert@freudenbergs.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(0,0,0)">Somehow I missed Eliot's version, but unsurprisingly he had exactly the same idea (use "last" not "stop" for hash). I'd still think bitXor: is preferable to bitOr, that is the standard way in almost all hash methods. But ...</div><div style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(0,0,0)"><br></div><div style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(0,0,0)">BUT: I forgot about the super fallback in #=. That makes this discussion pretty much moot, because since</div><div style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(0,0,0)"><br></div><div style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(0,0,0)"><div><span class="m_250197334435620281gmail-m_335388873581903699m_-2536036565226334732gmail-m_-932239584867177897m_7538366150560162952gmail-Apple-tab-span" style="white-space:pre-wrap">   </span>#(1 2 3) = (1 to: 3) "true"</div><div><br></div><div>is true, this must also be true:</div><div><br></div><div><span class="m_250197334435620281gmail-m_335388873581903699m_-2536036565226334732gmail-m_-932239584867177897m_7538366150560162952gmail-Apple-tab-span" style="white-space:pre-wrap">        </span>#(1 2 3) hash = (1 to: 3) hash  "must be true"</div></div><div style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(0,0,0)"><br></div><div style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(0,0,0)">So the only proper fix IMHO is to remove #hash from Interval (or replace it with ^super hash and a proper comment)</div></div></div></blockquote><div><br></div><div><br></div><div>We discussed this a couple of weeks ago.  There is no need for </div><div>    #(1 2 3) = (1 to: 3) </div><div>to be true. </div><div>    #(1 2 3) = #[1 2 3]</div><div>isn’t true.  And we have hasEqualElements:.  So a more coherent approach is for the hack that makes intervals equal to arrays be discarded, and the hashes kept distinct.</div><div> </div></div></div></div></blockquote><div>And I agreed with you weeks ago, but looking at it closer, the code specifically says Interval is a species of Array.</div><div>Interestingly, ByteArray, which is a subclass of ArrayedCollection, doesn't set its species, so its species is ByteArray.  Which is desirable.</div><div><br></div><div>If we change the Interval #species to not be array, then many things break with Interval - most notably #select: and #collect:, so a major overhaul would be in store for that part of the code.</div><div><br></div><div>In line with Bert's allusion, if we removed the super = call, then #= is no longer associative between Interval's and Arrays:</div><div><div>(1 to: 3) = #(1 2 3) "false"</div><div>#(1 2 3) = (1 to: 3)" true"</div></div><div><br></div><div>So, I'm just fixing the Interval only part and punting on the issue between Interval and Array for now.</div><div><br></div><div>-cbc</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(0,0,0)"><br></div><div style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(0,0,0)">- Bert -</div><div style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(0,0,0)"><br></div></div></div>
<br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="m_250197334435620281gmail-m_335388873581903699m_-2536036565226334732gmail_signature"><div dir="ltr"><div><span style="font-size:small;border-collapse:separate"><div>_,,,^..^,,,_<br></div><div>best, Eliot</div></span></div></div></div></div></div>
<br>
</blockquote></div></div></div>