Flyer

Ow! Now we are entering the taboo area of state-smartness… In noForth we have the word FLYER . It handles state-smartness in a uniform way. FLYER uses DIVE and both are implementation dependent FLYER is a NOOP during compile time. This is what FLYER does when STATE=0 :

  1. forth goes in compile mode and compiles until end of definition
  2. then the compiled code is executed
  3. forth leaves compile mode and forgets the compiled code

  • In definitions

    : ." ( a n -- ) flyer ." ;

    This new .“ is state-smart

  • Outside of definitions we need -FLY

    : -FLY 2r> r> 2>r >r ; immediate ( r: x y z -- z x y )

    Use of conditionals is possible between FLYER and -FLY

    8 0  flyer  do i . loop   -fly

    (an)