X-Git-Url: https://thelambdalab.xyz/gitweb/index.cgi?a=blobdiff_plain;f=throw-catch.4th;fp=throw-catch.4th;h=0000000000000000000000000000000000000000;hb=1e77138f35f12ccc6fe20d943482ac6b57c3f7cd;hp=6bb88fb8696f2b5ca5c68d7b7c00fd0c65534589;hpb=90e92c642041f4a3174c29373d2dc4d366d746e1;p=scheme.forth.jl.git diff --git a/throw-catch.4th b/throw-catch.4th deleted file mode 100644 index 6bb88fb..0000000 --- a/throw-catch.4th +++ /dev/null @@ -1,39 +0,0 @@ -\ Words implementing exception handling - -: catch - execute - type ; - -: throw ( addr -- ) - begin - R> 2dup 1- ' catch = - while - drop - repeat - - >R -; - -: return-depth - RSP@ RSP0 - 1- ; - -: stack-trace - RSP0 1+ begin - dup RSP@ < - while - dup @ 1- @ >name cr .name - 1+ - repeat - - drop -; - -: trace - cr ." ---" cr - ." Return stack depth:" return-depth . cr - ." Stack trace:" - stack-trace - cr ." ---" cr - - trace -;