home .. forth .. colorforth mail list archive ..

Re: [colorforth] Re-connecting


Mark,

On Wed, 2 Mar 2005 14:10:37 -0500 (EST)
Mark Slicker <maslicke@xxxxxxxxxxx> wrote:

<snip>
> >>> To which Terry (I presume it was Terry at this point) replied:
> >> Forth, with a nested vocabulary structure, can provide the basis for
> >> 'attribute typed' data storage. The basic managed 'physical' tree
> >structure is> provided by the vocabulary nesting.
> 
> Is there some online reference for the nested Forth vocabulary? I have 
> some touble understanding the techniques described below, how the search 
> is performed, ect.
> 
<snip>

The only online reference that I am aware of is the source for 'prok', a
"minimal 32bit direct threaded subroutine 1x study" that is part of the 
'5 Forths w/source'. URL:
http://www.modest-proposals.com/binary/4thish3.zip

Rather than have the forth word 'Forth' which holds the link to the latest
definition, you have 'Context' and 'Current'. 

'Context' points to the current named vocabulary which points to the latest
definition in that vocabulary. 'Find' uses 'Context' to search thru.

'Current' points to the current named vocabulary which points to the latest
definition being compiled to. New definitions are created and linked into
'Current'.

The find vocabulary 'Context' is available to search other vocabularies than
'Current'. You can say 'Editor' to invoke search in the Editor vocabulary, but
still remember the vocabulary you are compiling in.

Creating a new vocabulary, say 'Editor', creates vocabulary word 'Editor' in
the parent vocabulary, e.g. 'Forth'. The data field is a zero length name
and link to the vocabulary 'Forth'. New 'Editor' definitions are linked to
this data field. When the 'Editor' vocabulary search fails, 'Find' continues
searching thru the parent vocabulary, 'Forth' in this case.

This is different from all other forths I have seen which use *hack* hashed
and or vocabulary stacks. You run out of vocabularies just when you need them
most or, if hashed, just add needless complications.

Regards,
Terry

---------------------------------------------------------------------
To unsubscribe, e-mail: colorforth-unsubscribe@xxxxxxxxxxxxxxxxxx
For additional commands, e-mail: colorforth-help@xxxxxxxxxxxxxxxxxx
Main web page - http://www.colorforth.com