<div dir="ltr"><div>But would we want to mutate an Interval???</div><div>I would consider an Interval as read-only and would lock the inst-vars just after setting if it were me, likewise for Point and some other species...</div><div><br></div><div>IMO, the test is wrong in this regard.</div><div>We should not expect that #sorted always answer a copy, if we don't need one.</div><div>What we should expect is that #sorted do NEVER mutate the receiver, which is a different thing, contrarily to #sort which should.</div><div>The test should rather assert that original is not mutated by original sorted...<br></div><div><br></div><div>Of course, if what we really want is a #sortedCopy behavior, then we can add this innocuous copy...</div><div>But IMO it is not necessary.<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le mar. 27 août 2019 à 15:04, Tobias Pape <<a href="mailto:Das.Linux@gmx.de" target="_blank">Das.Linux@gmx.de</a>> a écrit :<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><br><div><br><blockquote type="cite"><div>Begin forwarded message:</div><br class="gmail-m_-1818478330082285073gmail-m_-8261481223731351693Apple-interchange-newline"><div style="margin:0px"><span style="font-family:-webkit-system-font,Helvetica Neue,Helvetica,sans-serif;color:rgb(0,0,0)"><b>From: </b></span><span style="font-family:-webkit-system-font,Helvetica Neue,Helvetica,sans-serif">Philippe Marschall <<a href="mailto:notifications@github.com" target="_blank">notifications@github.com</a>><br></span></div><div style="margin:0px"><span style="font-family:-webkit-system-font,Helvetica Neue,Helvetica,sans-serif;color:rgb(0,0,0)"><b>Subject: </b></span><span style="font-family:-webkit-system-font,Helvetica Neue,Helvetica,sans-serif"><b>[SeasideSt/Grease] GRIntervalTest >> #testSorted assumes new collection (#95)</b><br></span></div><div style="margin:0px"><span style="font-family:-webkit-system-font,Helvetica Neue,Helvetica,sans-serif;color:rgb(0,0,0)"><b>Date: </b></span><span style="font-family:-webkit-system-font,Helvetica Neue,Helvetica,sans-serif">27. August 2019 um 14:55:35 MESZ<br></span></div><div style="margin:0px"><span style="font-family:-webkit-system-font,Helvetica Neue,Helvetica,sans-serif;color:rgb(0,0,0)"><b>To: </b></span><span style="font-family:-webkit-system-font,Helvetica Neue,Helvetica,sans-serif">SeasideSt/Grease <<a href="mailto:Grease@noreply.github.com" target="_blank">Grease@noreply.github.com</a>><br></span></div><div style="margin:0px"><span style="font-family:-webkit-system-font,Helvetica Neue,Helvetica,sans-serif;color:rgb(0,0,0)"><b>Cc: </b></span><span style="font-family:-webkit-system-font,Helvetica Neue,Helvetica,sans-serif">Subscribed <<a href="mailto:subscribed@noreply.github.com" target="_blank">subscribed@noreply.github.com</a>><br></span></div><div style="margin:0px"><span style="font-family:-webkit-system-font,Helvetica Neue,Helvetica,sans-serif;color:rgb(0,0,0)"><b>Reply-To: </b></span><span style="font-family:-webkit-system-font,Helvetica Neue,Helvetica,sans-serif">SeasideSt/Grease <<a href="mailto:reply+AAA5D32XUYEK5HDHSCXBQ3N3OJUNPEVBNHHBZ5E5ZI@reply.github.com" target="_blank">reply+AAA5D32XUYEK5HDHSCXBQ3N3OJUNPEVBNHHBZ5E5ZI@reply.github.com</a>><br></span></div><div style="margin:0px"><span style="font-family:-webkit-system-font,Helvetica Neue,Helvetica,sans-serif;color:rgb(0,0,0)"><b>Delivered-To: </b></span><span style="font-family:-webkit-system-font,Helvetica Neue,Helvetica,sans-serif"><a href="mailto:tobias@netshed.de" target="_blank">tobias@netshed.de</a><br></span></div><br><div><p>GRIntervalTest >> #testSorted assumes new a collection is returned. This is no longer true with the latest Squeak.</p></div></blockquote><br></div><div>I just looked, all #sorted return a copy, except Interval:</div><div><br></div><div>"</div><div><div>sorted</div><div><span class="gmail-m_-1818478330082285073gmail-m_-8261481223731351693Apple-tab-span" style="white-space:pre-wrap">      </span>"an Interval is already sorted"</div><div><span class="gmail-m_-1818478330082285073gmail-m_-8261481223731351693Apple-tab-span" style="white-space:pre-wrap">       </span>step < 0 ifTrue: [^self reversed].</div><div><span class="gmail-m_-1818478330082285073gmail-m_-8261481223731351693Apple-tab-span" style="white-space:pre-wrap">   </span>^self</div><div>"</div><div><br></div><div>Shouldn't that rather be this?</div><div><br></div><div>"</div><div><div>sorted</div><div><span class="gmail-m_-1818478330082285073gmail-m_-8261481223731351693Apple-tab-span" style="white-space:pre-wrap">      </span>"an Interval is already sorted"</div><div><span class="gmail-m_-1818478330082285073gmail-m_-8261481223731351693Apple-tab-span" style="white-space:pre-wrap">       </span>step < 0 ifTrue: [^self reversed].</div><div><span class="gmail-m_-1818478330082285073gmail-m_-8261481223731351693Apple-tab-span" style="white-space:pre-wrap">   </span>^self copy</div><div>"</div><div><br></div><div><br></div></div></div>Best regards<div><span class="gmail-m_-1818478330082285073gmail-m_-8261481223731351693Apple-tab-span" style="white-space:pre-wrap">   </span>-Tobias</div></div><br>
</blockquote></div>