<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"><<a href="mailto:monty2@programmer.net" target="_blank">monty2@programmer.net</a>></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>
> Sent: Friday, October 21, 2016 at 11:26 PM<br>
> From: "Eliot Miranda" <<a href="mailto:eliot.miranda@gmail.com">eliot.miranda@gmail.com</a>><br>
> To: "The general-purpose Squeak developers list" <<a href="mailto:squeak-dev@lists.squeakfoundation.org">squeak-dev@lists.<wbr>squeakfoundation.org</a>><br>
> Subject: Re: [squeak-dev] Re: The defaullt implementation of isEmpty might do too much work<br>
<div class="HOEnZb"><div class="h5">><br>
> Hi Monty,<br>
><br>
> what happens if you add an isEmpty implement ration based in size to SequenceableCollection?<br>
><br>
> _,,,^..^,,,_ (phone)<br>
><br>
> > On Oct 21, 2016, at 3:59 PM, monty <<a href="mailto:monty2@programmer.net">monty2@programmer.net</a>> wrote:<br>
> ><br>
> > 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've now made #isEmpty slower for every collection that implements #size just to benefit ones whose careless authors didn't and so the implementors of lazy collections have one fewer message to override.<br>
> ><br>
> > Do not do this. People already avoid #ifEmpty: and related messages where performance matters and shouldn't have to avoid #isEmpty too.<br>
> ><br>
><br>
><br>
<br>
</div></div></blockquote></div><br></div>