[Newbies] Proper object removal
r.j.rothwell at gmail.com
Wed Jun 4 12:05:29 UTC 2008
On Wed, Jun 4, 2008 at 3:55 AM, Norbert Hartl <norbert at hartl.name> wrote:
> The objects are still referenced in the collection you get
> from self selected. The line with "each := nil" is useless
> as each is only a temporary variable. I assume that you want
> to empty the selected collection as well. you could do
> self selected copy do: [:each |
> self abstractors remove: each.
> self selected remove: each.
So...why would I use a copy (self selected copy) in this case? Is that a
clue to my misunderstanding?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Beginners