[BUG]Collection>>removeAll:

Valloud Andres Andres.Valloud at oya.state.or.us
Wed Aug 28 20:31:00 UTC 2002


Hello.

> MY expectation for
>    x removeAll: y
>is "x has all the elements in y removed; y is unchanged UNLESS IT IS x".
My expectations are not violated.

Quantify the usefulness of your expectations.  Please provide real life
examples where x removeAll: x is used as an intention revealing feature in a
dialect-independent manner.

> In short, #removeAll: is being blamed for not agreeing with expectations
that have never been justified elsewhere in Smalltalk.  NOT a valid argument
against conforming to the standard.

The main issue is that it is unclear and intention obscuring (plus what I
said in my previous message).

The standard also says the argument is to be uncaptured, which is defined as
meaning the receiver doesn't acquire direct or indirect references to it.  I
think the spirit of this was "leave the argument alone".

Saying "the result is undefined when argument==receiver" also coincides with
the "leave the argument alone" attitude.

The ANSI standard isn't written in stone.  I'd rather amend the standard
than agreeing with it regardless of the cost.

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


More information about the Squeak-dev mailing list