X-Git-Url: https://thelambdalab.xyz/gitweb/index.cgi?a=blobdiff_plain;f=catch-throw.4th;h=9192082d105ec7efa220965a3478b996672226b1;hb=3eaf389aa81bcfbf8dd64c89520925413d5c2390;hp=5c66df3299fd57455052b07d654d7d3d78b8f371;hpb=eb78b40c04fd1d78cdb0a3050575c9acdf4c6cbb;p=scheme.forth.jl.git diff --git a/catch-throw.4th b/catch-throw.4th index 5c66df3..9192082 100644 --- a/catch-throw.4th +++ b/catch-throw.4th @@ -1,6 +1,7 @@ \ Exception handling variable handler +0 handler ! : catch ( cfa -- exception# | 0 ) psp@ >R @@ -15,7 +16,12 @@ variable handler : throw ( ... exception# -- ... exception# ) ?dup 0= if exit then - handler @ rsp! + handler @ ?dup 0= if + ." Aborting: Uncaught exception " . ." ." cr + abort + then + + rsp! R> handler ! R> swap >R