P4_DO_ALL_WORDS_WHIL(3)

NAME
p4_do_all_words_while - DO-ALL-WORDS-WHILE ( some-wordlist* "word" -- ) [EXT]

SYNOPSIS

#include <pfe/pfe-base.h>

FCode p4_do_all_words_while(---);

DESCRIPTION

EXECUTE each entry in the wordlist in the reverse order defined but only as long as after EXECUTE of "word" a TRUE flag is left on the stack. The wordlist execution is cut when a FALSE flag is seen. (the current wordlist entry is _not_ on the stack!)

      : DO-ALL-WORDS-WHILE '
           STATE @ IF LITERAL, COMPILE DO-ALL-WORDS-WHILE-LOOP EXIT THEN
           &gt;R 0 FIRST-NAME
           BEGIN ?DUP WHILE
              R@ EXECUTE 0= IF R&gt;DROP DROP EXIT THEN
              DUP NAME&gt; EXECUTE
              NAME-NEXT
           REPEAT R&gt;DROP
      ;

to run the NEW-WORDLIST in original order, use REDO-ALL-WORDS