<div dir="auto">Remonder: this is because interval is used for text selection and/or cursor position. From that POV, 3 to: 2 is not equal to 4 to: 3. From collection POV, they are both an empty collection. I think that i once proposed to distinguish the two usages and introduce a TextInterval for that purpose.</div><br><div class="gmail_quote"><div dir="ltr">Le lun. 29 oct. 2018 à 01:35, Chris Cunningham <<a href="mailto:cunningham.cb@gmail.com">cunningham.cb@gmail.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Sun, Oct 28, 2018 at 2:53 PM Nicolas Cellier <<a href="mailto:nicolas.cellier.aka.nice@gmail.com" target="_blank" rel="noreferrer">nicolas.cellier.aka.nice@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"><a href="http://bugs.squeak.org/view.php?id=3380" target="_blank" rel="noreferrer">http://bugs.squeak.org/view.php?id=3380</a></div></div></blockquote><div><br></div><div>and </div><div> </div><div><div>Intervals:</div><div><div>   (0 to: 1) = (0 to: 5/3). "true"</div><div>   (0 to: 1) hash = (0 to: 5/3) hash. "false"</div></div></div><div><br></div><div>In the inbox is collections-cbc.810.mcz, which fixes both of these bugs.</div><div><br></div><div>You can test them out - #hash still replicates the bugs, while #hashBetterFastArrayCompatible (on Interval) and #hashBetterFastIntervalCompatible (on Array) makes both work.  The later also implements your idea of only testing some of the elements - the first and last 16.</div><div><br></div><div>It slows down hash speed of Interval roughly an order of magnitude, though.</div><div><br></div><div>If anyone hash ideas I'd be interested. Failing that, I'll ruminate on them for the next several days, and eventually push something in that fixes this (meanwhile moving that package to treated).</div><div>-----</div><div>Here is the series of 'tests' that I did while working on these with various timings.</div><div><br></div><div><div>{</div><div>[(1 to: 100 by: 1) hash] bench.</div><div>[(1 to: 100 by: 1) hashBetter] bench.</div><div>[(1 to: 100 by: 1) hashBetterAlsoFixBug3380] bench.</div><div>[(1 to: 100 by: 1) hashSlowerBetterAlsoFixBug3380] bench.</div><div>[(1 to: 100 by: 1) hashFastArrayCompatible] bench.</div><div>[(1 to: 100 by: 1) hashBetterFastArrayCompatible] bench.</div><div>'---'.</div><div>[(1 to: 100.3 by: 1) hash] bench.</div><div>[(1 to: 100.3 by: 1) hashBetter] bench.</div><div>[(1 to: 100.3 by: 1) hashBetterAlsoFixBug3380] bench.</div><div>[(1 to: 100.3 by: 1) hashSlowerBetterAlsoFixBug3380] bench.</div><div>[(1 to: 100.3 by: 1) hashFastArrayCompatible] bench.</div><div>[(1 to: 100.3 by: 1) hashBetterFastArrayCompatible] bench.</div><div>}</div><div><br></div><div>{</div><div><span style="white-space:pre-wrap">   </span>(0 to: 1) = (0 to: 5/3). </div><div><span style="white-space:pre-wrap">       </span>(0 to: 1) hash = (0 to: 5/3) hash.</div><div><span style="white-space:pre-wrap">       </span>(0 to: 1) hashBetter = (0 to: 5/3) hashBetter.</div><div><span style="white-space:pre-wrap">   </span>(0 to: 1) hashBetterAlsoFixBug3380 = (0 to: 5/3) hashBetterAlsoFixBug3380.</div><div><span style="white-space:pre-wrap">       </span>(0 to: 1) hashSlowerBetterAlsoFixBug3380 = (0 to: 5/3) hashSlowerBetterAlsoFixBug3380.</div><div><span style="white-space:pre-wrap">   </span>(0 to: 1) hashFastArrayCompatible = (0 to: 5/3) hashFastArrayCompatible.</div><div><span style="white-space:pre-wrap"> </span>(0 to: 1) hashBetterFastArrayCompatible = (0 to: 5/3) hashBetterFastArrayCompatible.</div><div>}</div><div><br></div><div><br></div><div>{</div><div><span style="white-space:pre-wrap">   </span>(1 to: 3) = #(1 2 3).</div><div><span style="white-space:pre-wrap">    </span>(1 to: 3) hash = #(1 2 3) hash.</div><div><span style="white-space:pre-wrap">  </span>(1 to: 3) hashBetter = #(1 2 3) hash.</div><div><span style="white-space:pre-wrap">    </span>(1 to: 3) hashBetterAlsoFixBug3380 = #(1 2 3) hash.</div><div><span style="white-space:pre-wrap">      </span>(1 to: 3) hashSlowerBetterAlsoFixBug3380 = #(1 2 3) hash.</div><div><span style="white-space:pre-wrap">        </span>(1 to: 3) hashFastArrayCompatible = #(1 2 3) hashFastIntervalCompatible.</div><div><span style="white-space:pre-wrap"> </span>(1 to: 3) hashBetterFastArrayCompatible = #(1 2 3) hashBetterFastIntervalCompatible.</div><div>}</div></div><div><br></div><div>-cbc<br></div></div></div></div></div></div>
<br>
</blockquote></div>