• Re: named wordlist

    From albert@spenarnc.xs4all.nl@21:1/5 to ruvim.pinka@gmail.com on Wed Oct 30 13:59:56 2024
    In article <vfslvv$20cbt$1@dont-email.me>,
    Ruvim <ruvim.pinka@gmail.com> wrote:
    When a word list is created with `vocabulary`, it is associated with a
    name, and `order` displays this name in its output.

    When a word list is created by `wordlist`, it is not associated with a
    name. Therefore, `order` typically displays a number for that word list, >which is less informative.

    A Forth system might try to find a constant whose value is identical to
    the wid of such word list and display the name of the constant. Do you
    know if this approach is used anywhere?

    Some Forth systems technically can associate a name with a word list
    after the word list is created with `wordlist`. And some even provide an
    API for doing so.

    Do you know of any Forth systems that technically *cannot* associate a
    name with a word list created with `wordlist` (due to internal details)?

    VOCABULARY didn't make it in the standard because conflicts.
    Every sane Forth uses VOCABULARY , or in my case NAMESPACE
    because I didn't want to make a choice.
    [If you load a program and you get the definition of VOCABULARY
    incompatible, and you don't notice it, this means a hard to find
    bug]

    So every sane Forth normally displays the names of namespaces,
    (and not the handles you get form GET-ORDER,)
    however they are defined via VOCABULARY or NAMESPACE.

    However:
    Supposed I abuse the data structure wordlist in a lisp implementation.
    They are used with SEARCH-WORDLIST and some such, but if they
    happens to be present in the search order, it make no sense to
    hunt for a name associated with it.

    A typical situation is
    WORDLIST CONSTANT my-lisp-whatever

    Are you going to inspect all constants?
    or worse

    _ _ class lisp
    M: lisp-words ALSO @ CONTEXT ! M; ( wordlist id commaed in ) ,
    M: .... M; .
    M: whatever ... M;

    endclass

    Usage :
    17 wordlist lisp my-lisp

    --
    Ruvim


    Groetjes Albert
    --
    Temu exploits Christians: (Disclaimer, only 10 apostles)
    Last Supper Acrylic Suncatcher - 15Cm Round Stained Glass- Style Wall
    Art For Home, Office And Garden Decor - Perfect For Windows, Bars,
    And Gifts For Friends Family And Colleagues.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Anton Ertl@21:1/5 to Ruvim on Wed Oct 30 18:38:57 2024
    Ruvim <ruvim.pinka@gmail.com> writes:
    When a word list is created with `vocabulary`, it is associated with a
    name, and `order` displays this name in its output.

    When a word list is created by `wordlist`, it is not associated with a
    name. Therefore, `order` typically displays a number for that word list, >which is less informative.

    A Forth system might try to find a constant whose value is identical to
    the wid of such word list and display the name of the constant. Do you
    know if this approach is used anywhere?

    Gforth 0.7.9_20241016
    ...
    wordlist constant foo ok
    foo >order ok
    order foo Forth Forth Root Forth ok
    wordlist ok 1
    variable bla ok 1
    constant bar ok
    bar >order ok
    order <139623990855032> foo Forth Forth Root Forth ok

    I.e., Gforth supports the usage

    wordlist constant foo

    in ORDER, but not the general case.

    Some Forth systems technically can associate a name with a word list
    after the word list is created with `wordlist`. And some even provide an
    API for doing so.

    All standard Forth systems support CONSTANT. Or what do you mean with "associate a name with a word list"?

    - 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 2024: https://euro.theforth.net

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From albert@spenarnc.xs4all.nl@21:1/5 to ruvim.pinka@gmail.com on Fri Nov 1 13:57:35 2024
    In article <vfslvv$20cbt$1@dont-email.me>,
    Ruvim <ruvim.pinka@gmail.com> wrote:
    When a word list is created with `vocabulary`, it is associated with a
    name, and `order` displays this name in its output.

    When a word list is created by `wordlist`, it is not associated with a
    name. Therefore, `order` typically displays a number for that word list, >which is less informative.

    ORDER SEE LOCATE .S are introspective words.
    They are inseparable from the Forth they belong too.
    Neither of these words has an output that you can build on to generate
    other words.
    So they are "best effort" words, they can be high quality if present
    in an elaborate system like gforth, or they can be missed at all.
    In ciforth you can recompile the result of SEE , while other Forth's
    priority is to give insight of e.g. optimisation.


    A Forth system might try to find a constant whose value is identical to
    the wid of such word list and display the name of the constant. Do you
    know if this approach is used anywhere?

    In view of the above, I consider philosophizing about how to further
    define the above words futile.

    <SNIP>

    --
    Ruvim


    Groetje Albert
    --
    Temu exploits Christians: (Disclaimer, only 10 apostles)
    Last Supper Acrylic Suncatcher - 15Cm Round Stained Glass- Style Wall
    Art For Home, Office And Garden Decor - Perfect For Windows, Bars,
    And Gifts For Friends Family And Colleagues.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)