0 votes
by Salvatore Insalaco (150 points)

Loading this simple Forth program with "include" after using "cold":

empty
4 constant /reg
create registers 0 l, 0 l, 0 l, 0 l, 0 l, 0 l, 0 l, 0 l,
registers 32 dump

Gives the result:

0000:0000:0059:4870  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ................
0000:0000:0059:4880  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ................

That's correct, but immediately after loading it: 

registers 32 dump
0000:0000:0059:4870  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ................
0000:0000:0059:4880  00 00 00 00 00 00 00 00  90 48 59 00 00 00 00 00  .........HY.....

Where "90 48 59 00" is the value of "here". Something in include corrupted the dictionary.

This doesn't happen if:
1. You just copy and paste the code.
2. You use include-file.

The length of the path seems to be part of the issue: mine is 81 characters.

1 Answer

0 votes
by Stephen Pelc (4.3k points)
selected by Salvatore Insalaco
 
Best answer
I always use EMPTY interactively. Run from within an include file will destroy some of the include file data (I think). The include file data system needs a rewrite - there are a couple of other side effects that need to be removed.
by Salvatore Insalaco (150 points)
Thank you Stephen, I can confirm that replacing "EMPTY" with "[DEFINED] reset [IF] reset [THEN] marker reset" resolved the issue.
...