pfe-exception-ext ? Exception + extensions
CATCH ( catch-xt* -- 0 | throw#! ) ?=>? ( | ) ; | ? |
"[ANS] FORTH"
;THROW ( throw#! -- [THROW] | throw# -- ) ?=>? ( | ) ; | ? |
"[ANS] FORTH"
;ABORT ( -- [THROW] ) ?=>? ( | ) ; | ? |
"[ANS] FORTH"
;ABORT" ( [string<">] -- [THROW] ) ?=>? ( | ) ; | ? |
"[ANS] FORTH"
;
CATCH ( catch-xt* -- 0 | throw#! ) [ANS] => "[ANS] FORTH"
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.
THROW ( throw#! -- [THROW] | throw# -- ) [ANS] => "[ANS] FORTH"
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
ABORT ( -- [THROW] ) [ANS] => "[ANS] FORTH"
throw - cleanup some things and go back to the QUIT routine
: ABORT -1 THROW ;
ABORT" ( [string<">] -- [THROW] ) [ANS] => "[ANS] FORTH"
throw like ABORT
but print an additional error-message
to stdout telling what has happened.