do-all-words-while:chainlist — compiling primitive
EXTENSIONS
DO-ALL-WORDS-WHILE
( wordlist* "word" -- )( | ) ; |
; |
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 >R 0 FIRST-NAME BEGIN ?DUP WHILE R@ EXECUTE 0= IF R>DROP DROP EXIT THEN DUP NAME> EXECUTE NAME-NEXT REPEAT R>DROP ;
to run the NEW-WORDLIST in original order, use REDO-ALL-WORDS