[BUG]Collection>>removeAll:

Allen Wirfs-Brock Allen_Wirfs-Brock at Instantiations.com
Thu Aug 29 00:39:45 UTC 2002


At 06:35 PM 8/28/2002 +1200, Richard A. O'Keefe wrote:
>         - If we come up with a way to detect this case and generate an error,
>         then the only remaining rationale for extending removeAll: to support
>         the special case of the receiver as an argument would be if it was
>         required by ANSI, or made the library or its specification 
> simpler and
>         cleaner, or fixed an actual bug.  I believe that none of these 
> has been
>         demonstrated to be true.
>
>Oh COME ON.  I have quoted the ANSI standard at length to demonstrate
>that it *does* require the argument==receiver case to be supported.
>
>I have also explained repeatedly not only _that_ the change makes the
>specification simpler and cleaner, but _how_ it makes the specification
>simpler and cleaner.

I must have missed the messages where you quoted the standard, but I did 
consult the actual text of the actual standard (not a draft). The words are 
what they are and I see how you could interpret them such that they allow 
the position you are taking.  However, as a very active participant in the 
drafting of the standard, I can tell you that it was not the committee's 
intent to require this!  This is an issue we missed. If somebody had 
brought it up in committee we would have said something explicitly, one way 
or another. And I can assure you that it is extremely likely that what 
would have been said, is that the case where the receiver and the argument 
are the same object is undefined. In the standard "undefined" means that 
implementations can do anything they want and that programmers should not 
depend upon any specific result. This would have been done to accommodate 
existing existing implementations (probably all of them, at the time) that 
"fail" in this case.

The words that appear in the standard are what they are.  However, you are 
using them to justify a position that was not intended by the collective 
authors.

Allen_Wirfs-Brock at Instantiations.com




More information about the Squeak-dev mailing list