do-all-words-while-loop:chainlist — ordinary primitive
EXTENSIONS
DO-ALL-WORDS-WHILE-LOOP
( wordlist* xt -- )( | ); |
| ; |
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-LOOP >R
0 FIRST-NAME
BEGIN ?DUP WHILE
R@ EXECUTE 0= IF R>DROP DROP EXIT THEN
DUP NAME> EXECUTE
NAME-NEXT
REPEAT R>DROP
;
compare with DO-ALL-WORDS-WHILE