|
That is exactly how this kind of stuff is done in C, and boy does that lead to ugly code. It is tedious, error prone, and, again, ugly but this can be done. Unfortunately, all that gets broken as soon as somebody starts using long jumps liberally, and Lua is a very liberal user of them, because that is how it implements its errors.