| |
|
| \ !! explain handler on-stack structure |
\ !! explain handler on-stack structure |
| |
|
| |
Variable first-throw |
| |
: nothrow ( -- ) first-throw on ; |
| |
|
| : (try) ( ahandler -- ) |
: (try) ( ahandler -- ) |
| |
first-throw on |
| r> |
r> |
| swap >r \ recovery address |
swap >r \ recovery address |
| rp@ 'catch >r |
rp@ 'catch >r |
| :noname ( y1 .. ym error/0 -- y1 .. ym / z1 .. zn error ) \ exception |
:noname ( y1 .. ym error/0 -- y1 .. ym / z1 .. zn error ) \ exception |
| ?DUP IF |
?DUP IF |
| [ here forthstart 9 cells + ! ] |
[ here forthstart 9 cells + ! ] |
| |
first-throw @ IF |
| store-backtrace error-stack off |
store-backtrace error-stack off |
| |
first-throw off |
| |
THEN |
| handler @ ?dup-0=-IF |
handler @ ?dup-0=-IF |
| >stderr cr ." uncaught exception: " .error cr |
>stderr cr ." uncaught exception: " .error cr |
| 2 (bye) |
2 (bye) |