<div dir="ltr"><div>Please retry with latest trunk version.<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-10-22 6:48 GMT+02:00 monty <span dir="ltr">&lt;<a href="mailto:monty2@programmer.net" target="_blank">monty2@programmer.net</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Putting #size-based implementations in abstract Collection subclasses negates the lazy collection benefit and still penalizes non-abstract direct Collection subclasses like CharacterSet and any user-defined direct Collection subclass implemented using composition with forwarding to a concrete collection. If the default linear complexity of #size and #isEmpty bothers you so much, make #size a subclassResponsiblity like #do: instead of suddenly penalizing collections whose authors actually did the right thing by providing a non-linear #size implementation.<br>
<br>
&gt; Sent: Friday, October 21, 2016 at 11:26 PM<br>
&gt; From: &quot;Eliot Miranda&quot; &lt;<a href="mailto:eliot.miranda@gmail.com">eliot.miranda@gmail.com</a>&gt;<br>
&gt; To: &quot;The general-purpose Squeak developers list&quot; &lt;<a href="mailto:squeak-dev@lists.squeakfoundation.org">squeak-dev@lists.<wbr>squeakfoundation.org</a>&gt;<br>
&gt; Subject: Re: [squeak-dev] Re: The defaullt implementation of isEmpty might do too much work<br>
<div class="HOEnZb"><div class="h5">&gt;<br>
&gt; Hi Monty,<br>
&gt;<br>
&gt;     what happens if you add an isEmpty implement ration based in size to SequenceableCollection?<br>
&gt;<br>
&gt; _,,,^..^,,,_ (phone)<br>
&gt;<br>
&gt; &gt; On Oct 21, 2016, at 3:59 PM, monty &lt;<a href="mailto:monty2@programmer.net">monty2@programmer.net</a>&gt; wrote:<br>
&gt; &gt;<br>
&gt; &gt; All non-trivial collections implement #size or inherit a custom implementation, usually just as a return of an inst var. Your #do:-based one is 3x as slow in my tests, so you&#39;ve now made #isEmpty slower for every collection that implements #size just to benefit ones whose careless authors didn&#39;t and so the implementors of lazy collections have one fewer message to override.<br>
&gt; &gt;<br>
&gt; &gt; Do not do this. People already avoid #ifEmpty: and related messages where performance matters and shouldn&#39;t have to avoid #isEmpty too.<br>
&gt; &gt;<br>
&gt;<br>
&gt;<br>
<br>
</div></div></blockquote></div><br></div>