[BUG]Collection>>removeAll:
goran.hultgren at bluefish.se
goran.hultgren at bluefish.se
Thu Aug 22 06:37:17 UTC 2002
"Andrew C. Greenberg" <werdna at mucow.com> wrote:
> On Tuesday, August 20, 2002, at 03:32 AM, goran.hultgren at bluefish.se
> wrote:
>
> > I agree with everything said. :-)
> >
> > And when we are on the subject of removals in Collections. Here are a
> > few discoveries/thoughts/musings this morning - they may not lead
> > anywhere, but I thought I could share them anyhow:
> >
> > What about Collection>>removeAllSuchThat: ?
> >
> > I noticed the other day that this code:
> >
> > 'abc' removeAllSuchThat: [:x | x = $c ]
>
> Strings and Arrays are immutable as to their size. Thus, the #remove:
> message and its progeny, unsurprisingly, don't mean much in these
> contexts.
Yes, they are immutable and IMHO the above should throw up a notifier as
due to a "self shouldNotImplement" REGARDLESS of the values of the
arguments. Or am I missing something?
It seems to me that the removeAllSuchThat: method was added sometime but
we forgot to "block it" like we block
SequencableCollection>>remove:ifAbsent:. The point being that all other
of these "removing" methods inevitable end up in remove:ifAbsent: and
are caught there but since this one may not do that due to the arguments
we missed it.
But I think Richard has posted a FIX with some appropriate blocking
methods for this.
regards, Göran
More information about the Squeak-dev
mailing list
|