An old topic (pun intended)

Jonathan M Davis jmdavisProg at gmx.com
Sun Oct 16 10:31:14 PDT 2011


On Sunday, October 16, 2011 19:13:09 Timon Gehr wrote: 
> I don't agree that 'old' is very difficult to implement. Just evaluate
> what is inside the 'old' before you enter the in contract, store
> somewhere, maybe in hidden local variables, and make the data available
> in the out contract. Eiffel's 'old' does not do more than that.
> 
> (but perhaps there are implementation details in DMD that make this more
> difficult than necessary. I don't know.)

What if you're dealing with a class? You'd need to deep copy the entire object 
for it to work. There's no way built into the language to do that (not to 
mention that it would be horrifically inefficient).

- Jonathan M Davis


More information about the Digitalmars-d-learn mailing list