April 3, 2015
7:17 a.m.
On 04/01/2015 11:22 PM, Peter Uhnák wrote:
col := #(1 2 3 4 5) asOrderedCollection. col do: [ :each | col remove: each. ]. col
As a general rule in Smalltalk, a lot of hassle can be avoided avoiding loops. If you think you need a loop, stop and find a better way, it likely already exists, in this case as someone else already mentioned either #removeAll: or #removeSuchThat:. Smalltalk isn't procedural, loops aren't your bread and butter. -- Ramon Leon