The standard does *not* support - a removeAll: a - [was: Re: [BUG] Collection>>removeAll:]
Andrew C. Greenberg
werdna at mucow.com
Mon Sep 2 15:45:09 UTC 2002
On Monday, September 2, 2002, at 09:51 AM, Hans-Martin Mosner wrote:
> Looks to me like we would open another can of worms by relying on
> #copy semantics to get #removeAll: right.
> Note that I do agree that using #copy would improve the behavior of
> #removeAll: in certain situations, but it just does not fix it for the
> general case - because IMO that's impossible.
This was, of course, my point. Fixing a bug that might not be a bug to
introduce at least one bug that will certainly be a bug isn't the best
solution to this problem, particularly when the bug that might not be a
bug might not be a bug except in an obscure case where there isn't any
compelling need to fix the bug that might not be a bug.
Merely whining that a fundamental change to Collection is demanded
notwithstanding these problems because LinkedList isn't a "normal"
collection (which it isn't) is as silly as arguing that
ArraySliceCollection isn't yet a part of the core image. We shouldn't
do it in the absence of a comprehensive overhaul (including a
determination that same is needed) -- we are simply opening worms
everywhere to fix a maybe-a-bug that may or may not need fixing.
Notwithstanding that, I am sensible to Richard's suggestion that when
it is practicable to catch a circumstance that misbehaves, we shouldn't
do so silently. I am for adding the assert.
More information about the Squeak-dev
mailing list
|