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

When did you leave the object? There should be a check of the invariant as control leaves the object. At what moment does this happen.

The F# people struggled with this. In proof systems, you check invariants at exit, and get to assume them true at entrance. So you need to be very clear about entrance and exit.



Whenever you return from a public member function. You might wish for more flexibility, but it's a simple rule that's not difficult to work with.




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

Search: