|
Re: Recap: How to empty a collection: msg#00132lang.smalltalk.squeak.beginners
Blake a écrit : On Tue, 19 Feb 2008 15:19:40 -0800, nicolas cellier <ncellier@xxxxxxxxxxx> wrote: It seems that we are crossing all our posts! OK. Does a newbie need to use it? To empty a collection? (Or whatever?) Only an advanced newbie :) and in very rare case. For squeak core library removeAll, - pros: very generic - cons: #become: is not efficient, especially in large images. In fact, most #become: usages inherited from Smalltalk-80 have been removed from Squeak for this reason. It's wise not to reintroduce them. I'm trying to get at what should be a very simple thing without going to the metal, as it were. Unfortunately, modifying a core library has such implications. One thing I wasn't clear on is whether Bert's suggestion: Bert's suggestion is simple and works well. The only question is about efficiency. Up to (Down to?) subclasses to optimize it. Some proposed an alternative based on (self removeAll: self), and started writing optimized versions of #removeAll:. I think our biggest problem is that we have plenty possible ways to do it... Finding a balance between genericity and efficiency... Nicolas
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | RE: How to empty a collection?, Ramon Leon |
|---|---|
| Next by Date: | Re: Recap: How to empty a collection, nicolas cellier |
| Previous by Thread: | Re: Re: Recap: How to empty a collection, Blake |
| Next by Thread: | Re: Recap: How to empty a collection, Klaus D. Witzel |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |