[FIX] TextStreamFix ([er] questions)
Daniel Vainsencher
danielv at netvision.net.il
Sun Jun 8 22:36:16 UTC 2003
IIUC, one way to look at the problem is that some clients are calling
replaceFrom:to:with: when they want to be calling
copyReplaceFrom:to:with:.
Since there're <20 senders of replaceFrom:to:with:, it seems feasible to
look around and change the suspects to be paranoid and use
copyReplaceFrom:to:with:, and then fix the semantics of
replaceFrom:to:with: to be destructive, as they were meant to be.
Sounds right?
Daniel
Andreas Raab <andreas.raab at gmx.de> wrote:
> > > Text has also an in-place replacement method. It is
> > > replaceFrom: start to: stop with: replacement startingAt: repStart
> > I know. Since #replaceFrom:to:with: is supposed to be destructive, I'm
> > saying that instead of working around it, by using the lower level
> > #replaceFrom:to:with:startingAt: it might be better to fix
> > #replaceFrom:to:with: to be destructive,
>
> Uh, ah. Been there, tried that. Didn't work (last time I tried ;-)
>
> The problem is that there are various places in the system where Text
> instances are shared (most notably between models/morphs/paragraphs/editors)
> and if any of those use the destructive version your system's going to do
> really badly.
>
> If you want to fix #replaceFrom:to:with: then you first need to fix those
> places.
>
> Cheers,
> - Andreas
More information about the Squeak-dev
mailing list
|