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.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Squeak-dev