Sujet : Re: named wordlist
De : ruvim.pinka (at) *nospam* gmail.com (Ruvim)
Groupes : comp.lang.forthDate : 30. Oct 2024, 17:47:39
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vftnvc$27oht$1@dont-email.me>
References : 1 2
User-Agent : Mozilla Thunderbird
On 2024-10-30 16:59,
albert@spenarnc.xs4all.nl wrote:
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.
Because of what conflicts?
BTW, the word `vocabulary` was standardized in 2020.
See: <
https://forth-standard.org/proposals/vocabulary?hideDiff#reply-453>
It is possible to obtain the wid from a vocabulary:
: vocabulary>wordlist ( xt.vocabulary -- wid )
also execute
get-order swap >r 1- set-order r>
;
' forth vocabulary>wordlist forth-wordlist = .
\ this should print "-1"
-- Ruvim