DeltaStreams moving forward

Igor Stasenko siguctua at gmail.com
Thu Sep 6 08:06:44 UTC 2007


On 06/09/07, Göran Krampe <goran at krampe.se> wrote:
> Hi!
>
> > A small remark about #asAntiDelta.
> >
> > I think its better to rename it to one of:
> > #asReverseDelta
> > #reversed
> >
> > then code can look more nicely:
> >
> > self reversed apply
> >
> > or even:
> >
> > self reverseApply  (which will do exactly 'self reversed apply')
> >
> > I'm just don't like word 'Anti' in this context. For me, a words
> > 'reverse changes' have more closer meaning to 'undoing changes' than
> > 'anti changes'.
>
> Possibly so, yes, I probably agree. The base idea is of course that we
> only have one #apply method and we accomplish its "opposite" by instead
> constructing a Delta that does the opposite.
>
> There are also other "distinctions" we could make. For example, will a
> revert be exactly the same as if I had manually made changes to undo the
> previous changes? Or would it be exactly like an undo - leaving no trace
> that the original changes ever happened (like for example "versions" of
> methods)?
>
> And if we want both mechanisms - what will we call them? Should we use
> #revert (that does "self asReverseDelta apply" and thus adds a new Delta
> to the list of "applied Deltas") and #unapply for this "real" undo
> mechanism (that I guess would actually remove the Delta from the list of
> "applied Deltas")? Or is a real undo even considered a dangerous idea?
>

I think this ambiguousness can be solved trivially, at least at delta level:
If delta includes action 'add self to list of deltas', then reverse
should remove it from list.

For higher level tools , like delta updater (or whatever) it can be
done in following way:
- load delta
- envelop loaded delta in "logged delta"
- apply "logged delta", which will actually applies loaded delta and
adds itself to list of applied deltas.

And i don't think that deltas should care about having 2 or more ways
how it can be 'unapplied'. As you always saying - KISS :)


> Darcs has them both IIRC.
>
> And oh, lists of applied Deltas etc - these are also "new concepts" in the
> Squeak realm. SOooo many questions... :)
>

> regards, Göran
>
>
>


-- 
Best regards,
Igor Stasenko AKA sig.


More information about the Squeak-dev mailing list