PYGMY Forth 
Author Message
 PYGMY Forth

Category 7,  Topic 22
Message 139       Sat Apr 24, 1993
LRWEBBER [larry]             at 21:50 EDT

I have developed some utilities which I use only occasionally and would like
to load from disk only when needed. With Pygmy version 1.4 it is easy to load
additional words (using a DEFERed word strategy) from disk on an as needed
basis. I assume that by storing the address of HERE before loading the words
from disk that I can restore HERE to this previous value when the disk loaded
words are no longer needed. When I try this, however, I only succeed in
{*filter*} the system up. If my strategy is sound I'll fix the implementation. If
my strategy is not sound could someone tell me where I err? Thanks in advance.

-----
This message came from GEnie via willett.  You *cannot* reply to the author
using e-mail.  Please post a follow-up article, or use any instructions
the author may have included (USMail addresses, telephone #, etc.).



Fri, 20 Oct 1995 01:21:23 GMT  
 PYGMY Forth
Category 7,  Topic 22
Message 142       Sat May 01, 1993
B.RODRIGUEZ2 [Brad]          at 10:58 EDT

What you're trying to build is frequently called a "transient dictionary", and
Frank very quietly added this to Pygmy 1.4.  Look up the definitions of the
Pygmy words { } and PRUNE.  I don't know all the{*filter*}details.  Frank, can you
help out here?

Brad Rodriguez          B.RODRIGUEZ2 on GEnie


 So many projects....so little time.

-----
This message came from GEnie via willett.  You *cannot* reply to the author
using e-mail.  Please post a follow-up article, or use any instructions
the author may have included (USMail addresses, telephone #, etc.).



Fri, 20 Oct 1995 01:21:31 GMT  
 PYGMY Forth
Category 7,  Topic 22
Message 141       Mon Apr 26, 1993
ELLIOTT.C                    at 17:37 EDT

 -----via Canada Remote Systems

 Date: 04-26-93 (00:02)
   To: LRWEBBER [LARRY]
 From: GARY CHANSON
 Subj: PYGMY FORTH

 -> I assume that by storing the address of HERE before loading ->
 the words from disk that I can restore HERE to this previous
 value -> when the disk loaded words are no longer needed.

         You have more to do than just restoring the value of DP
 (HERE). You also must re-connect all the vocabulary linkages so
 that the dictionary can be searched.  Each vocabulary has a
 pointer (may FORTHs have more than one per vocabulary) to the
 last word defined.  That word is linked to the word before it,
 etc.  This is what FORGET does.  I don't know if Pygmy has
 FORGET, but if not, it can be added.  In addition, be careful of
 words in the transient program which might link to vectored word
 in the resident dictionary.  If those vectores don't get
 restored, you'll crash.

 -GJC
 ---
  * Channel 1(R) * 617-354-7077 * Cambridge MA * 85 lines
  * PostLink(tm) v1.05  CHANNEL1 (#15) : RelayNet(tm)

-----
This message came from GEnie via willett.  You *cannot* reply to the author
using e-mail.  Please post a follow-up article, or use any instructions
the author may have included (USMail addresses, telephone #, etc.).



Fri, 20 Oct 1995 01:21:29 GMT  
 PYGMY Forth
Category 7,  Topic 22
Message 140       Sun Apr 25, 1993
JETHOMAS [Jet]               at 23:30 EDT

Larry, as I understand it you load extra words, remembering where HERE was,
and you want to get rid of the extra words and free up space.  So you set HERE
to the old value.  This doesn't work.

What's going on is that you have a couple of different vocabularies, one for
all the usual commands and another one for immediate words.  There are linked
lists for each vocabulary -- each item is the base address of a command and
the contents of each is the address of an earlier-defined command.  If you
don't reset the top element in each linked list when you reset HERE, your
system will almost surely crash.

The way I vaguely remember it, the lists are offset from the address that
CONTEXT gives you.  The value in CONTEXT is the offset to get to the presently-
used list.

Frank Sergeant pointed out that you can't have more than 4 vocabularies total.
Actually you can have as many as you want provided you change the source code
to allow more space by CONTEXT and then metacompile.  He made metacompiling
really easy.  Until I looked carefully at his source code I misunderstood
about this.  [D  I figured that he had 2 bits free for each command (5 bits to
give 0-31 characters in the name, and 1 bit to say whether the new command can
be called yet) and so I assumed he used those 2 bits to say which of the 4
vocabularies each command was in.  With a system like that (if you could even
get it to work) you'd be stuck with only 4 vocabularies total, ever, unless
you did a lot of rewriting.  But the way he really did it, it's easy.

Incidentally, Frank Sergeant provided a more-or-less standard way to get rid
of the latest commands, in the extra source code that isn't automatically
loaded.  I don't have the details immediately handy, but it should be fairly
obvious if you look for it.
-----
This message came from GEnie via willett.  You *cannot* reply to the author
using e-mail.  Please post a follow-up article, or use any instructions
the author may have included (USMail addresses, telephone #, etc.).



Fri, 20 Oct 1995 01:21:26 GMT  
 PYGMY Forth
Category 7,  Topic 22
Message 143       Sat May 01, 1993
LRWEBBER [larry]             at 19:59 EDT

Jet, Gary, and Brad,

Thank you for responding! Now that you guys pointed it out to me it makes
sense. I think I knew that the link list pointers needed to be corrected but
apparantly I had accute brain fade (old age grrrr!).

I'll redesign my strategy based on your input (and use what FRANK S. has
provided in 1.4). What a neat little system! Just wish it had F- 83's multi-
tasker.

                                      Larry
-----
This message came from GEnie via willett.  You *cannot* reply to the author
using e-mail.  Please post a follow-up article, or use any instructions
the author may have included (USMail addresses, telephone #, etc.).



Fri, 20 Oct 1995 01:21:34 GMT  
 PYGMY Forth

Quote:
>Category 7,  Topic 22
>Message 139       Sat Apr 24, 1993
>LRWEBBER [larry]             at 21:50 EDT

>I have developed some utilities which I use only occasionally and would like
>to load from disk only when needed. With Pygmy version 1.4 it is easy to load
>additional words (using a DEFERed word strategy) from disk on an as needed
>basis. I assume that by storing the address of HERE before loading the words
>from disk that I can restore HERE to this previous value when the disk loaded
>words are no longer needed. When I try this, however, I only succeed in
>hanging the system up. If my strategy is sound I'll fix the implementation. If
>my strategy is not sound could someone tell me where I err? Thanks in advance.
>-----
>This message came from GEnie via willett.  You *cannot* reply to the author
>using e-mail.  Please post a follow-up article, or use any instructions
>the author may have included (USMail addresses, telephone #, etc.).


What about the dictionary threads that point above your HERE.


Fri, 20 Oct 1995 03:07:42 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. MOD and /MOD with Pygmy Forth

2. FILE-STATUS and RENAME-FILE in Pygmy Forth

3. >LPT in Pygmy Forth

4. .ATTR with >DIRECT in Pygmy Forth

5. does in Pygmy Forth

6. Pygmy Forth

7. Kermit protocol in Pygmy Forth

8. PYGMY Forth

9. PYGMY Forth

10. PYGMY Forth

11. PYGMY Forth

12. PYGMY Forth

 

 
Powered by phpBB® Forum Software