[BUG]Collection>>removeAll:

Valloud Andres Andres.Valloud at oya.state.or.us
Thu Aug 22 16:34:54 UTC 2002


My 2 cents on x removeAll: y.

I'd expect the argument y to be left as it is, while the receiver x now
doesn't contain any element that is in y.

When x == y, we have:

I'd expect x to be left as it is, while x now doesn't contain any element
that is in x.

In other words, I'd expect x to be left alone *and* to be empty at the same
time.  This only works on empty collections.

We arrive at this nonsense because the collections are identical.  Similar
arguments apply to addAll: and maybe others.

The expressions x removeAll: x and x addAll: x are not a special case or an
error condition: they are NONSENSE.  If they occur, the real problem is that
the intentions of the program are nonsense as written by the developer.

Andres.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20020822/ec320a81/attachment.htm


More information about the Squeak-dev mailing list