<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 bgcolor="#ffffff"><br><br>
BTW, I found the StackSizeWatcher in ProcessBrowser (by Hernán
Wilkinson) extremely useful for dealing with the bugs this snippet
made visible.<br></div></blockquote><div><br></div><div>:-)</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 bgcolor="#ffffff"><br>
Many collections can hold any kind of object. Those should not fail
when evaluating `aCollection includes: anObject`, for any object.
Others are specific for some kind of content, like String,
ByteArray, FloatArray, etc. It is ok for those to raise an error
when evaluating `aCollection includes: anObject`, if trying to add
that anObject would also fail. I see no problem there. Still, I
wouldn't object if people prefer to just make #includes: answer
false in those cases.<br></div></blockquote><div><br></div><div>I think that #includes: should not raise any exception, the same as #=, it should always return true or false.</div><div><br></div><div>Cheers!</div><div>Hernan.</div><div><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 bgcolor="#ffffff">
<br>
<blockquote type="cite">
<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>
</blockquote>
<br>
Cheers,<br>
<pre class="gmail-m_7813206503252972469moz-signature" cols="72">--
Juan Vuletich
<a class="gmail-m_7813206503252972469moz-txt-link-abbreviated" href="http://www.cuis-smalltalk.org" target="_blank">www.cuis-smalltalk.org</a>
<a class="gmail-m_7813206503252972469moz-txt-link-freetext" href="https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev" target="_blank">https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev</a>
<a class="gmail-m_7813206503252972469moz-txt-link-freetext" href="https://github.com/jvuletich" target="_blank">https://github.com/jvuletich</a>
<a class="gmail-m_7813206503252972469moz-txt-link-freetext" href="https://www.linkedin.com/in/juan-vuletich-75611b3" target="_blank">https://www.linkedin.com/in/juan-vuletich-75611b3</a>
@JuanVuletich</pre>
</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>