[BUG]Collection>>removeAll:
Andrew C. Greenberg
werdna at mucow.com
Fri Aug 23 02:47:16 UTC 2002
On Wednesday, August 21, 2002, at 11:03 PM, Richard A. O'Keefe wrote:
> Ralph Johnson <johnson at cs.uiuc.edu> wrote:
> But I think your "dead simple" fix is a horrible hack.
>
> It is a principled technique of general utility:
> whenever you are about to do incompatible things to one object,
> do one of those things to a copy instead.
I don't know about this Richard. #removeAll: implies certain
side-effects with respect to the receiver that render its meaningful
definition undefined when the parameter is modified during its
operation. By extending the defined range of #removeAll: for some, but
not all parameters that are modified during its operation, we invite a
more specific definition of the selector, perhaps:
#removeAllExceptWhenParameterIsEquivalentToReceiverInWhichCaseJustUseACopyButStillStayUndefinedForOtherCasesWhereTheParameterIsModifiedDuringExecution:
This suggests to me that the ugly hack characterization isn't entirely
off-base.
More information about the Squeak-dev
mailing list
|