--- gforth/kernel/cond.fs 1998/12/08 22:03:09 1.4 +++ gforth/kernel/cond.fs 1999/12/03 18:49:51 1.7 @@ -48,7 +48,9 @@ variable backedge-locals \ locals-list (valid at address) (third) \ types -0 constant defstart +[IFUNDEF] defstart +0 constant defstart \ usally defined in comp.fs +[THEN] 1 constant live-orig 2 constant dead-orig 3 constant dest \ the loopback branch is always assumed live @@ -78,13 +80,13 @@ variable backedge-locals 3 constant cs-item-size -: CS-PICK ( ... u -- ... destu ) \ tools-ext +: CS-PICK ( ... u -- ... destu ) \ tools-ext c-s-pick 1+ cs-item-size * 1- >r r@ pick r@ pick r@ pick rdrop dup non-orig? ; -: CS-ROLL ( destu/origu .. dest0/orig0 u -- .. dest0/orig0 destu/origu ) \ tools-ext +: CS-ROLL ( destu/origu .. dest0/orig0 u -- .. dest0/orig0 destu/origu ) \ tools-ext c-s-roll 1+ cs-item-size * 1- >r r@ roll r@ roll r@ roll rdrop @@ -124,7 +126,7 @@ variable backedge-locals POSTPONE ?branch >mark ; immediate restrict : ?DUP-IF ( compilation -- orig ; run-time n -- n| ) \ gforth question-dupe-if -\G This is the preferred alternative to the idiom "?DUP IF", since it can be +\G This is the preferred alternative to the idiom "@code{?DUP IF}", since it can be \G better handled by tools like stack checkers. Besides, it's faster. POSTPONE ?dup-?branch >mark ; immediate restrict @@ -296,6 +298,10 @@ Defer exit-like ( -- ) ' noop IS exit-like : EXIT ( compilation -- ; run-time nest-sys -- ) \ core + \G Return to the calling definition; usually used as a way of + \G forcing an early return from a definition. Before + \G @code{EXIT}ing you must clean up the return stack and + \G @code{UNLOOP} any outstanding @code{?DO}...@code{LOOP}s. exit-like POSTPONE ;s POSTPONE unreachable ; immediate restrict