--- gforth/kernel/cbr.fs 2006/03/05 14:10:52 1.8 +++ gforth/kernel/cbr.fs 2006/03/26 22:54:20 1.9 @@ -45,3 +45,18 @@ : REPEAT over 0= ?struc postpone AGAIN postpone THEN ; immediate restrict +0 CONSTANT case ( compilation -- case-sys ; run-time -- ) \ core-ext + immediate + +: of ( compilation -- of-sys ; run-time x1 x2 -- |x1 ) \ core-ext + \ !! the implementation does not match the stack effect + 1+ >r + postpone over postpone = postpone if postpone drop + r> ; immediate + +: endof ( compilation case-sys1 of-sys -- case-sys2 ; run-time -- ) \ core-ext end-of + >r postpone else r> ; immediate + +: endcase ( compilation case-sys -- ; run-time x -- ) \ core-ext end-case + postpone drop + 0 ?do postpone then loop ; immediate