Deutsch   English   Français   Italiano  
<vg2289$35mc8$1@dont-email.me>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!eternal-september.org!feeder2.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: sjack@dontemail.me (sjack)
Newsgroups: comp.lang.forth
Subject: Re: Toad using many vocabularies
Date: Fri, 1 Nov 2024 08:07:37 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 58
Message-ID: <vg2289$35mc8$1@dont-email.me>
References: <vg06r0$2o75r$1@dont-email.me> <a5fde3a7ae2cc7eaef371eebfdb814f6@www.novabbs.com>
Injection-Date: Fri, 01 Nov 2024 09:07:38 +0100 (CET)
Injection-Info: dont-email.me; posting-host="cb572e279128c01eb13c216c29d4c88f";
	logging-data="3332488"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1/8V06prd6oPQFKshKaXoHS"
User-Agent: tin/2.6.4-20240224 ("Banff") (Linux/6.8.0-47-generic (x86_64))
Cancel-Lock: sha1:AE6y7gc46XhCzDYInwp6ympkHog=
Bytes: 3312

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.