for  ( n -- )

published: 9 January 2022 / updated 13 February 2022

Lire cette page en français

 

vocabulary: forth

Marks the start of a loop for .. next

WARNING: the loop index will be processed in the interval [n..0], i.e. n+1 iterations, which is contrary to the other versions of the FORTH language implementing FOR..NEXT (FlashForth).

Example:

: myLoop ( ---) 
    10 for 
        r@ . cr  \ display loop index 
    next 
  ; 

Legal: site web personnel sans commerce / personal site without seling