removing all elements from a collection -djb

Derek Brans brans at
Sun Apr 20 18:08:32 UTC 2003

I can't seem to find a method for removing all elements from a collection.  I wonder why that is?

Perhaps it's because you're just expected to throw the whole collection out and use Collection new.

But suppose you wanted to keep the collection and just remove each element one by one.  What is the best way to implement that?

self removeAll: self.  "This doesn't work"

self removeAll: self copy  "Seems to work..."

Derek Brans
Nerd on a Wire
Web design that's anything but square 
phone: 604.874.6463
mailto: brans at
-------------- next part --------------
An HTML attachment was scrubbed...

More information about the Squeak-dev mailing list