Discussion:
FigForth Vocabularies
(too old to reply)
sjack
2024-07-13 14:38:45 UTC
Permalink
Went whole hog on Fig Forth vocabularies. FORTH contains mostly just
the released FigForth words. TOAD is main branch for toad works
(my customization's). OP is for operator words that don't normally
get compiled .e.g. short cut aliases. WRK is for developing new
words, running jobs, demos and tests.

Word sets that branch from TOAD (or anywhere) have their private
words in their private vocabularies. The word NIX was defined to
FORGET and fix VOC-link chain that may break and CONTEXT of remaining
vocabularies should a vocabulary be in the forgotten path and also
free allocated buffers in buffer links that no longer exist in the
dictionary. MARKER uses NIX and ANEW uses MARKER.
FORGET was left its simple self for times when forgetting
and it's known vocabularies (and allocated buffers) are not involved,
for example:
0 VALUE FOO ' FOO FORGET FOO CONSTANT DOVAL

It's no longer KISS:
OP DEFS \ See operator words (will want to see LSW)
TOAD LSW \ List words only in TOAD context, excludes
\ the FORTH words that TOAD links into.
WRK LSW \ List words only in WRK context, and ditto
( See why just OP TOAD LSW doesn't work? )

Using vocabularies to their fullest which adds a little complexity
may not be needed but the design was there and I wanted to see it
work and it's been simple enough so I'll just keep it.
--
me
sjack
2024-07-13 14:54:59 UTC
Permalink
sjack <***@dontemail.me> wrote:

Forgot to mention that DEFS is one of those shortcut aliases
for DEFINITIONS .
sjack
2024-07-13 16:37:42 UTC
Permalink
sjack <***@dontemail.me> wrote:

Showing some vocabularies and where they tie in:

:) myfig lib -p go

.. CURRENT and CONTEXT are TOAD Base: 10 Latest: DECOMP OK

-- load in some addtional word sets
"/go_rtc/rtc" /dir BACK ISN'T UNIQUE OK \ a BacForth wordset
"/go_rtc/screen" /dir S: ISN'T UNIQUE OK \ a split-screen wordset
--
-- Get word type code for vocabularies
--
"/wtcode/voc" /dir OK..
--
-- Using the word type code (double word) LSWT will list
-- what it finds in the context.
--
op defs OK..
forth 2dup lswt
CONTEXT is FORTH , CURRENT is OP
BUF TOAD EDITOR FORTH OK..
toad 2dup lswt
CONTEXT is TOAD , CURRENT is OP
SCREEN RTC DECOMP DIRVOC SCRKEY WRK MMVOC OP OK..
screen lswt
CONTEXT is SCREEN , CURRENT is OP
BTPAD OK


(
Side note: A while back DFX mentioned Wil Baden's directory for
block files. It only takes minutes to implement so I gave it a
try and found it interesting not so much as need for a file system
but because it allowed access to SCR _lines_ in a manner that SCR
lines could be addressed as keyword/value pairs, the value being
the rest of the line for evauation. So in the above /DIR is
using a directory path to locate a SCR line and evaluate it which
in the above is loading screens and files and fetching code
(much of which is unseen).
)
--
me
sjack
2024-07-13 18:42:16 UTC
Permalink
Post by sjack
0 VALUE FOO ' FOO FORGET FOO CONSTANT DOVAL
Had left out a fetch in the example. Should be:
0 VALUE FOO ' FOO @ FORGET FOO CONSTANT DOVAL

Loading...