Written the constructor for exceptions; in the process, added a

metadata slot as a first class slot of exceptions.
This commit is contained in:
Simon Brooke 2026-04-16 21:33:48 +01:00
parent f915a9993f
commit 83537391a6
11 changed files with 85 additions and 20 deletions

View file

@ -16,16 +16,19 @@
* @brief An exception; required three pointers, so use object of size class 3.
*/
struct exception_payload {
/** @brief the exception message. Expected to be a string, but may be anything printable. */
/** @brief the exception message. Expected to be a string, but may be anything printable. */
struct pso_pointer message;
/** @brief the stack frame at which the exception was thrown. */
/** @brief the stack frame at which the exception was thrown. */
struct pso_pointer stack;
/** a store (assoc list or hashtable (or `nil` of metadata */
struct pso_pointer meta;
/** @brief the cause; expected to be another exception, or (usually) `nil`. */
struct pso_pointer cause;
};
struct pso_pointer make_exception( struct pso_pointer message,
struct pso_pointer frame_pointer,
struct pso_pointer meta,
struct pso_pointer cause );
struct pso_pointer destroy_exception( struct pso_pointer fp,