Andrei Alexandrescu:
The problem with this is well-defining it. Since every in.xyz
expression could access an arbitrary method of the old object,
that means the whole object would need to be somehow
duplicated. Alternatively, all in.xyz expressions would need to
be evaluated before the function's entry point, which is weird
(what order? how about side effects? etc).
The whole in.xyz trick (or as in Eiffel old.xyz) is inherently
flimsy. I'd rather allow the user to save and check their own
state instead, without resorting to a complicated definition.
Then we have to take a look at how C# and Ada solve such problem
(both support the pre-state).
Bye,
bearophile