An 3.9 image for developers

Klaus D. Witzel klaus.witzel at cobss.com
Sat Sep 16 16:23:31 UTC 2006


Hi Ramon,

on Sat, 16 Sep 2006 18:07:06 +0200, you wrote:
> Klaus wrote:
>> You won't like it globally. Just do, when you need it,
>>   aCollection removeAll: aCollection copy
>>  and let #removeAll as is.
>>  /Klaus
>
> Why won't I like it globally?  Seems just a synonym for a common usage.

Yes, but only on first sight.

>    #removeAll: aCollection is in Collection, so putting #removeAll there  
> seems natural as well.

Every Collection subclass has its own efficient algorithm for "remove'em  
all" (whether implemented or not).

OrderedCollection for example, has indices for first and last element, so  
why copy an OrderedCollection in #removeAll and waste memory and time?

And, have you tested (#(1) removeAll) or (#(1) removeAll: #(1)), they are  
Collections. How are these potential bugs avoided.

> Secondly, I didn't write the refractoring browser, which is what calls  
> #removeAll, I added the extension to make it work, rather than changing  
> the browser.

Sure, I understand your position. So the quesion is, which of the two  
possible solutions must yield.

/Klaus




More information about the Squeak-dev mailing list