<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>Hi Nicolai,</div><div><br>On Nov 28, 2014, at 4:01 PM, Nicolai Hess &lt;<a href="mailto:nicolaihess@web.de">nicolaihess@web.de</a>&gt; wrote:<br><br></div><blockquote type="cite"><div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2014-11-28 16:39 GMT+01:00 Marcus Denker <span dir="ltr">&lt;<a href="mailto:marcus.denker@inria.fr" target="_blank">marcus.denker@inria.fr</a>&gt;</span>:<br><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"><br><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Fri, Nov 28, 2014 at 4:26 PM, Sven Van Caekenberghe <span dir="ltr">&lt;<a href="mailto:sven@stfx.eu" target="_blank">sven@stfx.eu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div><br>
&gt; On 28 Nov 2014, at 15:35, Marcus Denker &lt;<a href="mailto:marcus.denker@inria.fr" target="_blank">marcus.denker@inria.fr</a>&gt; wrote:<br>
&gt;<br>
&gt;<br>
&gt;&gt; On 27 Nov 2014, at 08:21, Marcus Denker &lt;<a href="mailto:marcus.denker@inria.fr" target="_blank">marcus.denker@inria.fr</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;&gt; On 26 Nov 2014, at 19:19, Eliot Miranda &lt;<a href="mailto:eliot.miranda@gmail.com" target="_blank">eliot.miranda@gmail.com</a>&gt; wrote:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Hi All,<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;&nbsp; &nbsp;IdentitySet&gt;&gt;collect: answers a Set, not an IdentitySet.&nbsp; Anyone else agree this is a serious bug?&nbsp; Anyone else disagree?<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; WTF??<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; (IdentitySet withAll: #(1 2 3 1.0 2.0 3.0)) collect: [:e| e] a Set(1.0 2 3)<br>
&gt;&gt;<br>
&gt;&gt; Yes, I would say so. I think we fixed some others like that already (not 100% sure)<br>
&gt;&gt;<br>
&gt;&gt; I added an issue tracker entry<br>
&gt;&gt;<br>
&gt;&gt; 14535&nbsp; &nbsp; &nbsp; &nbsp; IdentitySet&gt;&gt;collect: answers a Set, not an IdentitySet.<br>
&gt;&gt;&nbsp; &nbsp; &nbsp; <a href="https://pharo.fogbugz.com/f/cases/14535" target="_blank">https://pharo.fogbugz.com/f/cases/14535</a><br>
&gt;&gt;<br>
&gt;<br>
&gt; #collect: directly uses Set in Set&gt;&gt;#collect, I committed a fix (to the issue tracker, to be reviewed)<br>
&gt; to use “self species” instead (plus the example from above as a test in IdentitySetTest).<br>
&gt;<br>
&gt;&nbsp; &nbsp; &nbsp; &nbsp;Marcus<br>
<br>
</div></div>I think that is the most logical thing to do, it is what I would expect.<br>
<br>
I know others have cases where that is not really what you want (some of Set's subclasses are pretty special), but it is still a good default, while #collect:as: can be used for all other cases (and subclasses can override #species again if they want).<br>
<span><font color="#888888"><br></font></span></blockquote><div><br></div></div></div><div>Hmm... errors found by the test runner on that change.</div><div><br></div><div><a href="https://ci.inria.fr/pharo/job/Pharo-4.0-Issue-Validator/17683//artifact/validationReport.html" target="_blank">https://ci.inria.fr/pharo/job/Pharo-4.0-Issue-Validator/17683//artifact/validationReport.html</a><br></div><div><br></div><div>So we will need to check...&nbsp;</div><span class=""><font color="#888888"><div>&nbsp;</div></font></span></div><span class=""><font color="#888888"><div>&nbsp; &nbsp; Marcus</div>
</font></span></div></div>
</blockquote></div><br><br></div><div class="gmail_extra">In pharo, the problem is the OCKeyedSet, but the same happens in squeak with a KeyedSet.<br></div><div class="gmail_extra">Changing Set&gt;&gt;#collect: to use "self species new" the following code fails:<br><br>k:=KeyedSet new keyBlock:[:e | e name].<br>k addAll:{ Color red . Color blue . Color green}.<br>k collect:[:e | e ].<br>--&gt; MessageNotUnderstood: Color&gt;&gt;key<br></div></div></div></blockquote><br><div>And if you implement species in KeyedSet to answer Set (which should fix this one issue) does anything else break?<br style="-webkit-tap-highlight-color: rgba(26, 26, 26, 0.296875); -webkit-composition-fill-color: rgba(175, 192, 227, 0.230469); -webkit-composition-frame-color: rgba(77, 128, 180, 0.230469); "><br style="-webkit-tap-highlight-color: rgba(26, 26, 26, 0.296875); -webkit-composition-fill-color: rgba(175, 192, 227, 0.230469); -webkit-composition-frame-color: rgba(77, 128, 180, 0.230469); "><span style="-webkit-tap-highlight-color: rgba(26, 26, 26, 0.296875); -webkit-composition-fill-color: rgba(175, 192, 227, 0.230469); -webkit-composition-frame-color: rgba(77, 128, 180, 0.230469); ">Eliot (phone)</span></div></body></html>