Sujet : Re: Toad using many vocabularies
De : sjack (at) *nospam* dontemail.me (sjack)
Groupes : comp.lang.forthDate : 01. Nov 2024, 09:07:37
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vg2289$35mc8$1@dont-email.me>
References : 1 2
User-Agent : tin/2.6.4-20240224 ("Banff") (Linux/6.8.0-47-generic (x86_64))
mhx <
mhx@iae.nl> wrote:
(Assuming you *have* FORGET).
I have FORGET as well as MARKER and ANEW . FORGET was kept simple. MARKER
and ANEW will repare voclink chain, prune vocabulary word lists and free
allocated buffers as needed. See job scenario below for ANEW .
It is also messy to write a definition that needs words from different
vocabularies.
Don't think I've had that joy yet. Most definitions only needed one or two
vocabularies. Perhaps for that application a custom vocabulary which
contains aliases of words from many other needed vocabularies?
Emailed you text to give you background.
I've been operating this way for about a month and a half, some bumps along
the way but no major issues. List below some key points.
i. Vocabularies made immediate
Often vocabulary needed during compile time.
ii. These compile-time context changes do not occur at run-time.
ii. Often a context change at compile-time does not need to be
changed back in the compile if the other words are from a common
vocabulary (e.g. FORTH) linked to either the context or current.
i. Colon start changes CONTEXT to CURRENT
This is very nice. It means many definitions can compile in sequence
to the same CURRENT without regard to what the CONTEXT was left from
the previous compile. Of course the last context change make will need
to be managed.
i. Private vocabularies have little conflict because they are only used by
one parent vocabulary.
i. Use a common vocabulary (MISC) for private words shared among a group of
vocabularies.
i. Support words to save CURRENT to restore CONTEXT is valuable aid.
Typical job scenario:
WRK DEFS \ set context and current to WRK
\ all words defined will reside in WRK
ANEW job \ clear memory for the job
fload job \ load and run job
-- In the job
-VOC \ save CURRENT
( make context changes in or out of definitions as needed )
+VOC \ restore CONTEXT to saved CURRENT
defs \ only needed if CURRENT was changed in the job
-- Out of the job
ANEW JOB \ clear memory for next job
Note that these support words make your job definitions relative. The
job can be loaded in a scratch (WRK) vocabulary and then forgotten or
loaded into a trunk (TOAD) or FORTH vocabulary for expansion.