>>>>> "goran" == goran <goran@krampe.se> writes:goran> I would never use become: in "regular code" like this. :)
>> I'd just do:
>>
>> removeAll
>> self notEmpty ifTrue: [self become: self species new].
>>
>> and let subclasses make it more efficient using implementation knowledge.
First, how "regular" is it if the method hasn't been missed by anyone
in 27 years. :)
Second, what are you objecting to? #become: is clearly a part of the image,
and works fine. This code also cleans out a grown collection to be the
smallest it possiby can become, where delete-one-at-a-time solutions don't.