<div dir="ltr"><div dir="ltr"><br></div><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><br>without trying that, I know that Interval fails for anything that is not a Number, not sure if should be fixed or not. What do you think?</div></div></blockquote><div><br></div><div>A long time ago, when we implemented measures (Aconcagua) it was a surprise to me that Interval only worked with numbers and not with objects that define a total order, so we created ArithmeticObjectInterval that works for any object that complies with the protocol defined in ArithmeticObject and doing so, we could define intervals for measures, dates, years, and the like. </div><div>You can see it in the Aconcagua packages.</div><div><br></div><div>Cheers!</div><div>Hernan. </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><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jun 11, 2019 at 5:25 PM Juan Vuletich <<a href="mailto:juan@jvuletich.org" target="_blank">juan@jvuletich.org</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">On 6/11/2019 8:49 AM, Luciano Notarfrancesco via Cuis-dev wrote:<br>
> I did this to fish for inconsistencies:<br>
><br>
> instances _ OrderedCollection new.<br>
> Object withAllSubclassesDo: [:each| instances addAll: each allInstances].<br>
> instances _ instances asArray.<br>
><br>
> 1 to: instances size do: [:i|<br>
>     a _ instances at: i.<br>
>     aHash _ a hash.<br>
>     i+1 to: instances size do: [:j|<br>
>         b _ instances at: j.<br>
>         (a = b and: [(aHash = b hash and: [b = a]) not]) ifTrue: [self <br>
> halt]]]<br>
><br>
> (I typed it manually here, I hope I copied it right, but you get the <br>
> idea.)<br>
><br>
> Found out this:<br>
> - FeatureRequest forgets to implement hash;<br>
> - #() = Semaphore new, but not the other way around, and hashes also <br>
> differ;<br>
> - similarly, LinkedList new = Semaphore new;<br>
> - RunArray new = Object new fails because it assumes the argument is a <br>
> Collection and sends isSequenceable;<br>
> - RunArray new = Text new, but hashes differ;<br>
> - Set new = Dictionary new but hashes differ;<br>
><br>
> And there are more, I stopped before finishing.<br>
><br>
> I don't know how to fix some of those, and the implications of <br>
> changing the behavior of #= or #hash are not obvious in some cases. <br>
> But I think we should change Collection>>hash to set the initial value <br>
> to 0 instead of 'self species hash', and that would fix two of the <br>
> issues above. What do you think? Other ideas?<br>
<br>
I just pushed fixes to most of them. For Semaphore and RunArray it is a <br>
matter of implementing and honoring #species. For Set, it was making <br>
aDictionary is: #Set to answer false. For the others it was adding a new <br>
#hash or #= methods. I don't expect much breakeage.<br>
<br>
I'll run now a tweaked (hopefully faster) version of your script.<br>
<br>
Cheers,<br>
<br>
-- <br>
Juan Vuletich<br>
<a href="http://www.cuis-smalltalk.org" rel="noreferrer" target="_blank">www.cuis-smalltalk.org</a><br>
<a href="https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev" rel="noreferrer" target="_blank">https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev</a><br>
<a href="https://github.com/jvuletich" rel="noreferrer" target="_blank">https://github.com/jvuletich</a><br>
<a href="https://www.linkedin.com/in/juan-vuletich-75611b3" rel="noreferrer" target="_blank">https://www.linkedin.com/in/juan-vuletich-75611b3</a><br>
@JuanVuletich<br>
<br>
</blockquote></div>
-- <br>
Cuis-dev mailing list<br>
<a href="mailto:Cuis-dev@lists.cuis.st" target="_blank">Cuis-dev@lists.cuis.st</a><br>
<a href="https://lists.cuis.st/mailman/listinfo/cuis-dev" rel="noreferrer" target="_blank">https://lists.cuis.st/mailman/listinfo/cuis-dev</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="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 face="tahoma, sans-serif" size="2">-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 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>