Okay, i've thought things over a bit. Here's what we're going to do
to deal with infant mortality, exceptions, and suchlike things.
Important given: We can *not* use setjmp/longjmp. Period. Not an
option--not safe with threads. At this point, having considered the
alternatives, I wish it were otherwise but it's not. Too bad for us.
So, on to the rules/proclamations/exercise of unreasonable dictatorial power.
1) Functions are only responsible for ensuring liveness of
strings/buffers/PMCs up until the point they exit.
Strings/PMCs/Buffers that are returned to a caller are the caller's
problem.
2) All calls to routines which may fail must check for failure and
exit indicating an exception if they do so. They should exit as
gracefully as they can. They *may* override the exception if
appropriate. (Potentially voiding it, or throwing a different
exception)
3) Opcode functions which note that something they called has thrown
an exception are responsible for posting an interpreter exception.
4) Everything that can fail *must* be checked. So no code like:
string_foo(string_foo(), string_foo())
if string_foo can pitch an exception.
5) We're dealing with infant mortality by pushing baby strings on the
stack. We'll add in a stack_extend and quickpush routine to
pre-extend (guaranteed) the stack and push the potential baby
string/PMC/Buffer respectively.
Yes, these will be a pain to deal with. Alas, too bad for us.
--
Dan
--------------------------------------"it's like this"-------------------
Dan Sugalski even samurai
[EMAIL PROTECTED] have teddy bears and even
teddy bears get drunk