Diff for /gforth/except.fs between versions 1.11 and 1.14

version 1.11, 2006/10/08 11:30:56 version 1.14, 2006/12/28 20:53:03
Line 76  Defer store-backtrace Line 76  Defer store-backtrace
   
 \ !! explain handler on-stack structure  \ !! explain handler on-stack structure
   
   Variable first-throw
   : nothrow ( -- ) \ gforth
       \G Use this (or the standard sequence @code{['] false catch drop})
       \G after a @code{catch} or @code{endtry} that does not rethrow;
       \G this ensures that the next @code{throw} will record a
       \G backtrace.
       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
Line 125  is catch Line 134  is catch
 :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 + ! ]
         store-backtrace error-stack off          first-throw @ IF
               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)
Line 155  is throw Line 167  is throw
         rdrop 'throw r> perform          rdrop 'throw r> perform
     THEN ;      THEN ;
 is rethrow  is rethrow
 [THEN]  
   
   [THEN]

Removed from v.1.11  
changed lines
  Added in v.1.14


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>