Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

My solution is a little bit more hackish, but more usable imo. Not thoroughly tested though, might have some implications I haven't thought of.

http://pastebin.com/m7cc84252



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...




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: