<br><br><div class="gmail_quote">2008/6/4 Rob Rothwell <<a href="mailto:r.j.rothwell@gmail.com">r.j.rothwell@gmail.com</a>>:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d">On Wed, Jun 4, 2008 at 3:55 AM, Norbert Hartl <<a href="mailto:norbert@hartl.name" target="_blank">norbert@hartl.name</a>> wrote:<br></div><div class="gmail_quote"><div class="Ih2E3d"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div></div><div></div></div></blockquote></div></div></blockquote><div>Hi<br><br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="gmail_quote"><div class="Ih2E3d"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div><br>
</div></div>The objects are still referenced in the collection you get<br>
from self selected. The line with "each := nil" is useless<br>
as each is only a temporary variable. I assume that you want<br>
to empty the selected collection as well. you could do<br>
<br>
DataManager>>deleteSelectedAbstractors<br>
self selected copy do: [:each |<br>
self abstractors remove: each.<br>
self selected remove: each.<br>
]</blockquote></div><div><br>So...why would I use a copy (self selected copy) in this case? Is that a clue to my misunderstanding?<br><br>Rob<br></div></div></blockquote></div><br><br>because <br><br>self selected do: [:each |<br>
self selected remove: each ] is to avoid ... as it iterates on the collection on wich you're removing elements...<br><br>Try <br><br>aColl:=#(1 2 3) asOrderedCollection.<br>^aColl do: [:ea | aColl remove ea ]<br><br>
see here: <a href="http://bugs.squeak.org/view.php?id=6937">http://bugs.squeak.org/view.php?id=6937</a><br><br>Cédrick<br><br>