Dumping the current state with deepcopy is probably prohibitively expensive for real world use. Toss in some copy-on-write, and I think you've got something simple and usable...
much more usable than my example, but the copy on write is tricky, which I alluded too. In the case of objects, you need the entire object in order to act upon it, which means you have to copy the whole thing. Of course, if this was an actual language feature, it could be done with some sort of tracing probably, which would make it more efficient. Not sure how you could do that from user code...
apgwoz|16 years ago