PFE - Portable Forth Environment - pfe Forth Wordsets

  PFE 0.33.71 Homepage SourceForge Download Documentation -Overview -The PFE Manual old manual / (book) -ChangeLog -Authors -License (LGPL) -Wordsets / (book) -Functions .. (book) -Dp of ANS Forth -The 4thTutor -Forthprimer.pdf - Old Wordsets - Old Words List Forth Links * Forth Repository * Taygeta Compilation * TinyBoot FirmWare * FiCL, Free Forth * Research Vienna * Research Bournemouth * zForth WebRing Other Links * Tektronix/MPT * Forth Org. (FIG) * Forth Inc. * MPE Ltd. Forths * SF Win32Forth * PD Win32Forth * Neil Bawd generated (C) Guido U. Draheim guidod@gmx.de | ## chainlists - executable wordlists `NEW-WORDLIST``( "name" -- )``[EXT] [DOES: -- new-wordlist* ]` => `"EXTENSIONS"` create a new `WORDLIST` and a "name" with a runtime of ( -- wordlist* )
        : NEW-WORDLIST WORDLIST VALUE ;
        : NEW-WORDLIST CREATE: WORDLIST ;
  usually used for `DO-ALL-WORDS` / `DO-SYNONYM` primitive code = [p4_new_wordlist] `.WORDS``( some-wordlist* -- )``[EXT]` => `"EXTENSIONS"` print the `WORDLIST` interactivly to the user
        : .WORDS ALSO SET-CONTEXT WORDS PREVIOUS ;
  `WORDS` / `ORDER` / `NEW-WORDLIST` / `DO-ALL-WORDS` primitive code = [p4_dot_words] `REDO-ALL-WORDS``( some-wordlist* -- )``[EXT]` => `"EXTENSIONS"` `EXECUTE` each entry in the wordlist in the original order defined
        : REDO-ALL-WORDS
             0 FIRST-NAME
             0 SWAP ( under )
             BEGIN ?DUP WHILE
                DUP NAME> SWAP ( under )
                NAME-NEXT
             REPEAT
             BEGIN ?DUP WHILE
                EXECUTE
             REPEAT
        ;
  to run the `NEW-WORDLIST` in last-run-first order, use `DO-ALL-WORDS` primitive code = [p4_redo_all_words] `DO-ALL-WORDS``( some-wordlist* -- )``[EXT]` => `"EXTENSIONS"` `EXECUTE` each entry in the wordlist in the reverse order defined
        : DO-ALL-WORDS
             0 FIRST-NAME
             BEGIN ?DUP WHILE
                DUP NAME> EXECUTE
                NAME-NEXT
             REPEAT
        ;
  to run the `NEW-WORDLIST` in original order, use `REDO-ALL-WORDS` primitive code = [p4_do_all_words] `DO-ALL-WORDS-WHILE-LOOP``( some-wordlist* test-xt* -- )``[EXT]` => `"EXTENSIONS"` `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` primitive code = [p4_do_all_words_while_loop] `DO-ALL-WORDS-WHILE``( some-wordlist* "word" -- )``[EXT]` => `"EXTENSIONS"` `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` compiling word = [p4_do_all_words_while] `DO-SYNONYM``( some-wordlist* "do-name" "orig-name" -- )``[EXT]` => `"EXTENSIONS"` create a `SYNONYM` in the specified wordlist.
        : DO-SYNONYM GET-CURRENT SWAP SET-CURRENT SYNONYM SET-CURRENT ;
  `DO-ALIAS` / `DO-ALL-WORDS` / `NEW-WORDLIST` / `WORDLIST` / `ORDER` primitive code = [p4_do_synonym] `DO-ALIAS``( some-xt* definition-wordlist* "do-name" -- )``[EXT]` => `"EXTENSIONS"` create an `ALIAS` with the exec-token in the specified wordlist
        : DO-ALIAS GET-CURRENT SWAP SET-CURRENT SWAP ALIAS SET-CURRENT ;
  `DO-SYNONYM` primitive code = [p4_do_alias] `ALIAS-ATEXIT``( some-xt* "name" -- )``[EXT]` => `"EXTENSIONS"` create a defer word that is initialized with the given x-token.
        : ALIAS-ATEXIT ATEXIT-WORDLIST DO-ALIAS ;
`ATEXIT-WORDLIST` `DO-ALL-WORDS` primitive code = [p4_alias_atexit]