[BUG]Collection>>removeAll:

Jon Hylands jon at huv.com
Mon Aug 19 11:09:10 UTC 2002


On Mon, 19 Aug 2002 12:19:55 +0200 (MET DST), Ian Piumarta
<ian.piumarta at inria.fr> wrote:

> 	aCollection == self ifTrue: [^self species new].

Well, it doesn't preserve the identity of the collection. There's nothing
that says I have to care about what the method returns.

	aCollection := (1 to: 10) asSet..
	...
	someCondition
		ifTrue: [
			aCollection
				removeAll: aCollection;
				add: someElement.
			^true]

#removeAll *has* to be destructive to the receiver object. As well, it is
supposed to return the objects removed, not the new state of the recevier.

Later,
Jon

--------------------------------------------------------------
   Jon Hylands      Jon at huv.com      http://www.huv.com/jon

  Project: Micro Seeker (Micro Autonomous Underwater Vehicle)
           http://www.huv.com



More information about the Squeak-dev mailing list