<div>I believe Paolo is correct.  #sort: is supposed to return the receiver sorted in-place while #sorted: is supposed to return a sorted copy of the receiver.  A comment to this effect would be nice also :-)</div>
<div> </div>
<div>John<br></div>
<div class="gmail_quote">On Wed, Mar 31, 2010 at 6:31 AM, Paolo Bonzini <span dir="ltr">&lt;<a href="mailto:bonzini@gnu.org">bonzini@gnu.org</a>&gt;</span> wrote:<br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">
<div class="im">On 03/31/2010 12:24 PM, Julian Fitzell wrote:<br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">&gt;&gt;&gt;    sorted: sortBlock<br>&gt;&gt;&gt;  +       ^ self sortBy: sortBlock!<br>&gt;&gt;&gt;  -       ^ (self sortBy: sortBlock) as: self species!<br>
</blockquote></blockquote>&gt;<br>&gt;  #species of SortedCollection is SortedCollection. Sorting a<br>&gt;  SortedCollection with a non-default sortBlock, but then the collection<br>&gt;  is converted to a SortedCollection with a default sort block, what<br>
&gt;  gives the default sorting.<br>&gt;<br>&gt;  I don&#39;t know if it is correct to remove the #as: and what was its<br>&gt;  intention? It doesn&#39;t break any tests though, so I guess it is fine.<br>&gt;  Alternatively we could implement the method in SortedCollection like<br>
&gt;  this.<br></blockquote>I think the tests are not thorough enough then, though I thought I had<br>tests for the class of the returned object (maybe we removed them<br>because they were failing?). But it does seem like #sorted:, which<br>
returns a copy, should be returning an instance of #species (certainly<br>this is necessary for classes like Interval, which has a species of<br>Array).<br></blockquote><br></div>Wouldn&#39;t that be  ^(self as: self species) sortBy: sortBlock?<br>
<font color="#888888"><br>Paolo</font> 
<div>
<div></div>
<div class="h5"><br>_______________________________________________<br>seaside-dev mailing list<br><a href="mailto:seaside-dev@lists.squeakfoundation.org" target="_blank">seaside-dev@lists.squeakfoundation.org</a><br><a href="http://lists.squeakfoundation.org/mailman/listinfo/seaside-dev" target="_blank">http://lists.squeakfoundation.org/mailman/listinfo/seaside-dev</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>John O&#39;Keefe [|], Principal Smalltalk Architect, Instantiations Inc.<br>