"Exception + extensions"

exception [ANS]
* CATCH ( xt -- 0|n )

execute the given execution-token and catch
any exception that can be caught therein.
software can arbitrarily raise an exception
using THROW - the value 0 means there
was no exception, other denote implementation
dependent exception-codes.

FORTH/ANS exception (dpANS9.6.1.0875) ordinary primitive

* THROW ( n -- )

raise an exception - it will adjust the depth
of all stacks and start interpreting at the point
of the latest CATCH

if n is null nothing happens, the -1 (ie. FALSE )
is the raise-code of ABORT - the other codes
are implementation dependent and will result in
something quite like ABORT

FORTH/ANS exception (dpANS9.6.1.2275) ordinary primitive

* ABORT ( -- ) no-return

throw - cleanup some things and go back to the QUIT routine
 : ABORT -1 THROW ;

FORTH/ANS exception (dpANS9.6.2.0670) ordinary primitive

* ABORT" ( [string<">] -- ) no-return

throw like ABORT but print an additional error-message
to stdout telling what has happened.

FORTH/ANS exception compiling primitive

ENVIRONMENT ENVIRONMENT EXCEPTION-EXT

[] no special info, see general notes

ENVIRONMENT exception ordinary constant

EXTENSIONS NEXT-EXCEPTION

[] no special info, see general notes

FORTH/EXTENSIONS exception threadstate variable

no or not matching binary image

[] no special info, see general notes

FORTH/EXTENSIONS exception exception declared

binary image too big

[] no special info, see general notes

FORTH/EXTENSIONS exception exception declared

out of memory

[] no special info, see general notes

FORTH/EXTENSIONS exception exception declared

index out of range

[] no special info, see general notes

FORTH/EXTENSIONS exception exception declared

compile failed (call from bad point)

[] no special info, see general notes

FORTH/EXTENSIONS exception exception declared