• Gforth standard wordsets

    From David Meyer@papa@sdf.org to comp.lang.forth on Thu Sep 24 14:38:09 2026
    From Newsgroup: comp.lang.forth

    The Gforth manual documents a "wordset" for each word. Many of these
    wordsets are defined in the ANS Forth standard. However, these wordsets
    do not appear in the list of system vocabularies and wordlists displayed
    by VOCS. I think the standard wordsets are included in the vocabulary
    "Forth".

    Is there any way to access individual wordsets from within the Gforth environment? I'd like to set up the search order to allow the use of
    only a subset of standard words.
    --
    David Meyer
    Takarazuka, Japan
    papa@sdf.org
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From albert@albert@spenarnc.xs4all.nl to comp.lang.forth on Thu Sep 24 13:34:28 2026
    From Newsgroup: comp.lang.forth

    In article <87ecejfbum.fsf@localhost>, David Meyer <papa@sdf.org> wrote:
    The Gforth manual documents a "wordset" for each word. Many of these
    wordsets are defined in the ANS Forth standard. However, these wordsets
    do not appear in the list of system vocabularies and wordlists displayed
    by VOCS. I think the standard wordsets are included in the vocabulary >"Forth".

    Is there any way to access individual wordsets from within the Gforth >environment? I'd like to set up the search order to allow the use of
    only a subset of standard words.

    There is a general way to do this, that works on any Forth.
    Define a wordlist and call this RESTRICTED (whether you use VOCABULARY
    or NAMESPACE to define a named wordlist)
    Define FROM and IMPORT appropriately.
    Then specify
    RESTRICTED DEFINITIONS
    FROM FORTH IMPORT DROP 2DROP ROT SWAP 2SWAP
    ..
    ad nauseam.
    ..

    \ An non-portable implementation on ciforth:

    \ Intended to be used "FROM: wordlist IMPORT <name1> <name2> "
    \ Announce wordlist, temporarily added to search order
    : FROM: ; \ For NAMESPACE
    \ : FROM: ALSO ; \ For VOCABULARY

    \ Import remainder of the line to CURRENT, then remove "FROM:"d context.
    : IMPORT ^J PARSE SAVE SET-SRC
    BEGIN GET-NAME DUP WHILE FOUND ALIAS REPEAT 2DROP \ 1]
    RESTORE PREVIOUS ;

    Then start your program with
    ONLY RESTRICTED

    1] SET-SRC (string-constant - ) set the input temporarily to the string.
    Gforth supplies EXECUTE-PARSING that provides a similar function,
    only more cumbersome.

    I used a similar mechanism to define a mini-forth with 64 words, plus
    3 debug words (show stack, clear stack, words) and 4 for
    extending(include import from: want)

    --
    David Meyer

    Groetjes Albert
    --
    The Chinese government is satisfied with its military superiority over USA.
    The next 5 year plan has as primary goal to advance life expectancy
    over 80 years, like Western Europe.
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From dxf@dxforth@gmail.com to comp.lang.forth on Thu Sep 24 22:39:53 2026
    From Newsgroup: comp.lang.forth

    On 24/09/2026 3:38 pm, David Meyer wrote:
    The Gforth manual documents a "wordset" for each word. Many of these
    wordsets are defined in the ANS Forth standard. However, these wordsets
    do not appear in the list of system vocabularies and wordlists displayed
    by VOCS. I think the standard wordsets are included in the vocabulary "Forth".

    Is there any way to access individual wordsets from within the Gforth environment? I'd like to set up the search order to allow the use of
    only a subset of standard words.

    Wil Baden did something like that. See 'Forth Dimensions' vol20 no3

    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From anton@anton@mips.complang.tuwien.ac.at (Anton Ertl) to comp.lang.forth on Thu Sep 24 16:21:37 2026
    From Newsgroup: comp.lang.forth

    David Meyer <papa@sdf.org> writes:
    The Gforth manual documents a "wordset" for each word. Many of these
    wordsets are defined in the ANS Forth standard. However, these wordsets
    do not appear in the list of system vocabularies and wordlists displayed
    by VOCS. I think the standard wordsets are included in the vocabulary >"Forth".

    Yes, words from the standard wordsets, as well as most other words are
    in FORTH-WORDLIST, which is the wordlist of the vocabulary FORTH.

    A wordset is not a wordlist.

    Is there any way to access individual wordsets from within the Gforth >environment? I'd like to set up the search order to allow the use of
    only a subset of standard words.

    You can find wordset information in the files answords.fs,
    2012words.fs, and standard-words.fs.

    - anton
    --
    M. Anton Ertl http://www.complang.tuwien.ac.at/anton/home.html
    comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html
    New standard: https://forth-standard.org/
    EuroForth 2026 CFP: http://www.euroforth.org/ef26/cfp.html
    --- Synchronet 3.22a-Linux NewsLink 1.2