John Heyes ANS Forth test suite contains the following definition:
: IFFLOORED [ -3 2 / -2 = INVERT ] LITERAL IF POSTPONE \ THEN ;
This is then used to conditionally define different words depending on whether we use gender or symmetric division:
IFFLOORED : T/MOD >R S>D R> FM/MOD ;
So it IFFLOOREDacts like noop or \depending on the result of the expression. Good. This is easily implemented in my stream interpreter by doing this:
: POSTPONE ' , ; IMMEDIATE
... and now it IFFLOOREDworks; the definition is equivalent : IFFLOORED -1 IF ['] \ EXECUTE THEN ;.
Unfortunately, the following code is located further in the test suite:
: GT1 123 ;
: GT4 POSTPONE GT1 ; IMMEDIATE
: GT5 GT4 ;
\ assertion here that the stack is empty
. POSTPONE , GT4 : GT4 123 ;... GT4 . , GT5 , 123 , GT5 noop. ; GT5, 123 . , POSTPONE , :
: POSTPONE ' LITERAL ['] , LITERAL ;
, , gForth, , POSTPONE :
: GT1 123 ;
: GT4 POSTPONE GT1 ; IMMEDIATE
SEE GT4
<long number> compile, ;
. , ( IFFLOORED \, ). , ( GT4 , push).
... gForth.
, ?