Attached is a test program with some macros allowing code like:
TRY {
some();
}
CATCH {
clean_up();
RETHROW;
}
some() {
...
THROW(NULL_PMC_ACCESS);
}
The actual implementation would need either an explicit Parrot_Interp
argument or assume an C<interpreter> is around. malloc()/free() would be
replaced by a free_list handling like in C<new_internal_exception>. On
interpreter creation a few of these C<Parrot_exception>s would be
created and put onto the C<interpreter->exc_free_list>.
Some questions:
- are these macros ok? (Yes I know - debugging :)
- Can the macro names interfer with existing ones?
- do we need an additional message text like now in internal_exception?
leo