On Fri, 20 Nov 2015, Clément Bera wrote:
You can use whileTrue: if it's a problem for you not to evaluate the limit at each iteration of the loop. If you look at OrderedCollection for example, there are implemented differently in Pharo/VW and Squeak. Pharo and VW use to:do: whereas Squeak uses whileTrue: to iterate over the collection. Hence, if you remove elements from the OrderedCollection while iterating over it, the behavior is different.
One should refrain from modifying collections during iteration. In case of OrderedCollection there's #removeAllSuchThat: to let one safely remove elements from the collection while iterating over it.
Levente
