[BUG]Collection>>removeAll:
Richard A. O'Keefe
ok at cs.otago.ac.nz
Thu Aug 22 05:35:33 UTC 2002
"Andrew C. Greenberg" <werdna at mucow.com> wrote:
goran.hultgren at bluefish.se wrote:
> 'abc' removeAllSuchThat: [:x | x = $d ]
Strings and Arrays are immutable as to their size. Thus, the #remove:
message and its progeny, unsurprisingly, don't mean much in these
contexts.
That was his point. The operation does not in general make sense,
and yet *this* call is quietly allowed. The surprising thing is not
that #removeAllSuchThat: *doesn't* "work" for Strings, but that sometimes
it *does*.
That's why removeAll-raok implements this method as "self shouldNotImplement"
so that _all_ calls to the method with an Array or String argument will
report an error.
More information about the Squeak-dev
mailing list
|