Hi,

I've just run into quite a nasty surprise
~~~~~~~~~~~~~~~~
col := #(1 2 3 4 5) asOrderedCollection.
col do: [ :each | col remove: each. ].
col
~~~~~~~~~~~~~~~~
it throws "NotFound: nil not found in OrderedCollection"
I tested it also in Pharo3 and there it just silently removed first, third
and fifth element.

Looking at the implementation of OrderedCollection>>do:  it seems that
doing what I'm doing is a bad idea.

So what shall one do:? col copy do: [...] ?

Why can't do: be a bit smarter? Optimization?

Thanks,
Peter

Reply via email to