>I think that Ernest has addressed this concern before.  I'm fairly
>sure that he said something like "...you can't put the genie back in
>the bottle" -- meaning that once you've made one or more function
>calls on the RHS, they are un-retractable as would be any Java method
>call.
>
>Now, if all they did was change your application's state in a more or
>less discrete way, then you could of course pre-store that state in
>memory and roll it back via a custom Undo function if something goes
>wrong.  However, if those RHS function calls that you fired off launch
>a rocket or something... well you get the picture.
>  
>
You could always declare (annotations, external data, ...) how to undo
certain actions: you could have things like add/remove,
increment/decrement, setTrue/setFalse, ...; then there might be
setter/getter pairs where you could store the previous value (returned
by the getter) before overwriting it; or you could use Cloneable to
store the complete state of an object (or use get/setState() methods),
etc, etc
But I agree, in general, backtracking over arbitrary Java calls is
difficult (a change to one object could trigger changes in the entire
object base), even when not regarding side-effects like I/O (which are
of course never backtrackable, even e.g. in Prolog)... Nonetheless I
think it might be interesting to do some work around this, but I doubt
anyone has the time ;-)

Greets,
Peter




begin:vcard
fn:Peter Van Weert
n:Van Weert;Peter
org:K.U.Leuven;Computer Science
adr:room 01.08;;Celestijnenlaan 200A;Heverlee;;3001;Belgium
email;internet:[EMAIL PROTECTED]
title:DTAI (Declarative Languages and Artificial Intelligence)
tel;work:+32 16 327064
x-mozilla-html:TRUE
url:http://www.cs.kuleuven.be/~petervw/
version:2.1
end:vcard

Reply via email to