Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

StrongForth implemented in ANS Forth

153 views
Skip to first unread message

Stephan Becher

unread,
Sep 29, 2008, 2:53:07 AM9/29/08
to
StrongForth can now be run as an application on top of every ANS Forth
system, making strong static type checking and operator overloading
available on all platforms for which an ANS Forth system exists. The
implementation is called StrongForth.f in order to distinguish it from the
original DOS based version of StrongForth. It has been successfully
validated with GForth and SwiftForth. It does not run on Win32Forth, because
Win32Forth still has a bug in (LOCAL).

Although StrongForth.f has its own interpreter loop and its own dictionary,
it takes full advantage of all optimizations that are incorporated in the
host system's compiler. There's almost no runtime penalty with respect to
the host system. Once StrongForth.f is up and running, words that have been
previously defined in the host system can be imported into StrongForth's
dictionary, provided an unambiguous stack diagram can be specified.

StrongForth.f has been extensively tested, and is well documented, including
a 20-pages introduction and a complete glossary. It is distributed under the
GNU General Public license. Version 1.0 is available for download at
<http://home.vrweb.de/stephan.becher/strongforth.f>.


Slava Pestov

unread,
Sep 29, 2008, 5:45:35 AM9/29/08
to
On Sep 29, 1:53 am, "Stephan Becher" <stephan.remove-this.bec...@t-

online.de> wrote:
> StrongForth can now be run as an application on top of every ANS Forth
> system, making strong static type checking and operator overloading
> available on all platforms for which an ANS Forth system exists.

This is a very impressive accomplishment. The code looks nice too. I'm
really glad to see that there are still people in the Forth community
who like to experiment and try new approaches to language design.

Slava

Bernd Paysan

unread,
Sep 29, 2008, 8:07:29 AM9/29/08
to
Stephan Becher wrote:

> StrongForth can now be run as an application on top of every ANS Forth
> system, making strong static type checking and operator overloading
> available on all platforms for which an ANS Forth system exists.

Thanks, good work.

Some critics I have with StrongForth:

* Case sensitive
* Typing system does not use ANS stack effect naming conventions, i.e. x <->
SINGLE, n <-> INTEGER, and so on

But now I can change that ;-).

--
Bernd Paysan
"If you want it done right, you have to do it yourself"
http://www.jwdt.com/~paysan/

Stephan Becher

unread,
Sep 30, 2008, 2:00:29 AM9/30/08
to
"Bernd Paysan" <bernd....@gmx.de> schrieb im Newsbeitrag
news:11t6r5-...@annette.zetex.de...

> Stephan Becher wrote:
>
>> StrongForth can now be run as an application on top of every ANS Forth
>> system, making strong static type checking and operator overloading
>> available on all platforms for which an ANS Forth system exists.
>
> Thanks, good work.
>
> Some critics I have with StrongForth:
>
> * Case sensitive

Well, that's a matter of personal taste. But since most Forth users seem to
prefer case insensivite systems, I included an appropriate compile-time
switch in strong.f.

> * Typing system does not use ANS stack effect naming conventions, i.e. x
> <->
> SINGLE, n <-> INTEGER, and so on

Good point. I don't remember exactly why I chose more expressive names for
the data types. After all, that was 18 years ago. I guess I wanted to avoid
possible name conflicts, e. g., with the single-character commands of the
FIG block editor I used at that time. Furthermore, there might be
ambiguities, e. g. with INTEGER (n) vs. SIGNED (also n).

I recommend defining a set of ALIASes, like these:

' SINGLE ALIAS x ( STACK-DIAGRAM -- 1ST )
' INTEGER ALIAS n ( STACK-DIAGRAM -- 1ST )
' UNSIGNED ALIAS u ( STACK-DIAGRAM -- 1ST )
' SIGNED ALIAS s ( STACK-DIAGRAM -- 1ST )
' CHARACTER ALIAS char ( STACK-DIAGRAM -- 1ST )
' ADDRESS ALIAS addr ( STACK-DIAGRAM -- 1ST )
' CADDRESS ALIAS c-addr ( STACK-DIAGRAM -- 1ST )
' LOGICAL ALIAS logical ( STACK-DIAGRAM -- 1ST )
' FLAG ALIAS flag ( STACK-DIAGRAM -- 1ST )
' DEFINITION ALIAS def ( STACK-DIAGRAM -- 1ST )
' TOKEN ALIAS xt ( STACK-DIAGRAM -- 1ST )
' FILE ALIAS file ( STACK-DIAGRAM -- 1ST )
' FAM ALIAS fam ( STACK-DIAGRAM -- 1ST )
' WID ALIAS wid ( STACK-DIAGRAM -- 1ST )
' R-SIZE ALIAS r-size ( STACK-DIAGRAM -- 1ST )
' CONTROL-FLOW ALIAS cf ( STACK-DIAGRAM -- 1ST )
' DOUBLE ALIAS xd ( STACK-DIAGRAM -- 1ST )
' INTEGER-DOUBLE ALIAS def ( STACK-DIAGRAM -- 1ST )
' UNSIGNED-DOUBLE ALIAS du ( STACK-DIAGRAM -- 1ST )
' NUMBER-DOUBLE ALIAS nd ( STACK-DIAGRAM -- 1ST )
' SIGNED-DOUBLE ALIAS sd ( STACK-DIAGRAM -- 1ST )
' DATA-TYPE ALIAS dt ( STACK-DIAGRAM -- 1ST )
' STACK-DIAGRAM ALIAS stack ( STACK-DIAGRAM -- 1ST )
' TUPLE ALIAS tuple ( STACK-DIAGRAM -- 1ST )
' INPUT-SOURCE ALIAS insrc ( STACK-DIAGRAM -- 1ST )
' SYS ALIAS sys ( STACK-DIAGRAM -- 1ST )
' ORIG ALIAS orig ( STACK-DIAGRAM -- 1ST )
' DEST ALIAS dest ( STACK-DIAGRAM -- 1ST )
' COLON-SYS ALIAS colon-sys ( STACK-DIAGRAM -- 1ST )
' DOES-SYS ALIAS does-sys ( STACK-DIAGRAM -- 1ST )
' DO-SYS ALIAS do-sys ( STACK-DIAGRAM -- 1ST )
' CASE-SYS ALIAS case-sys ( STACK-DIAGRAM -- 1ST )
' OF-SYS ALIAS of-sys ( STACK-DIAGRAM -- 1ST )

Regards,
Stephan


DavidM

unread,
Sep 30, 2008, 3:32:43 AM9/30/08
to
On Mon, 29 Sep 2008 08:53:07 +0200, Stephan Becher wrote:

> StrongForth.f has been extensively tested

Here's the result of my attempt to run strongforth.f under gforth 0.6.2
on a debian sid workstation:

~/work/sw/forth/strongforth$ gforth

Gforth 0.6.2, Copyright (C) 1995-2003 Free Software Foundation, Inc.
Gforth comes with ABSOLUTELY NO WARRANTY; for details type `license'
Type `bye' to exit

S" strong.f" INCLUDED

redefined current with CURRENT redefined dp with DP redefined latest
with LATEST redefined source-id with SOURCE-ID redefined 2nip with
2NIP redefined 2tuck with 2TUCK redefined m*/ with M*/ redefined umin
with UMIN redefined du> with DU> redefined d> with D> redefined d<>
with D<> redefined d0> with D0> redefined d0<> with D0<> redefined 2,
redefined rdrop with RDROP redefined offset with OFFSET redefined )
redefined get-current with GET-CURRENT redefined set-current with SET-
CURRENT redefined name with NAME redefined source with SOURCE
redefined parse with PARSE redefined parse-word with PARSE-WORD
redefined DT redefined .s with .S redefined dest with DEST redefined
number with NUMBER redefined interpret with INTERPRET redefined refill
with REFILL redefined Nesting with NESTING redefined prompt with
PROMPT redefined immediate with IMMEDIATE redefined SLiteral with
SLITERAL redefined (Constant) with (CONSTANT) redefined recurse with
RECURSE redefined create-local with CREATE-LOCAL redefined (local) with
(LOCAL) redefined (abort") with (ABORT") redefined .error with .ERROR
redefined Defer with DEFER redefined IS redefined cold with COLD
redefined ( redefined DOUBLE redefined locals with LOCALS redefined
exception with EXCEPTION ok

" corelib.sf" INCLUDE \ try as per instruction on website

*the terminal*:2: Hangup
" corelib.sf" INCLUDE
^^
Backtrace:
$B7A6F81C throw
$B7A70B40 DT>DT
$B7A70E38 INTERPRET
$D
$0
$0
$0
$B7A71E9C STRONG-EVALUATE

S" corelib.sf" INCLUDE \ try again, a different way

in file included from *the terminal*:3
/usr/local/lib/gforth/site-forth/:0: File I/O exception
Backtrace:
$B7A3C1FC throw
$B7A3BC9C perform
$B7A3C790 refill
$B7A40E9C execute
$B7FCFBBC
$B7FCBA00
$B7FD4000
$B7FD7FF0
$B7FCFB9C
$B7A40EB4
$B7A3C808 catch
$B7A3E80C execute-parsing-named-file
$B7A3E840 included1
$B7A3E8D0 included


Bernd Paysan

unread,
Sep 30, 2008, 4:30:16 AM9/30/08
to
DavidM wrote:
> " corelib.sf" INCLUDE \ try as per instruction on website

You must type in

strong

before (in a line of its own). STRONG switches over to the outer interpreter
of StrongForth.

I think we could do better if this outer interpreter is hooked into the
interpreter and compiler hooks of Gforth, so that the switching over can be
seamlessly achieved while interpreting a file, and a single include file
can load everything.

Stephan Becher

unread,
Sep 30, 2008, 8:05:25 AM9/30/08
to
"Bernd Paysan" <bernd....@gmx.de> schrieb im Newsbeitrag
news:ol49r5-...@annette.zetex.de...

> DavidM wrote:
>> " corelib.sf" INCLUDE \ try as per instruction on website
>
> You must type in
>
> strong
>
> before (in a line of its own). STRONG switches over to the outer
> interpreter
> of StrongForth.
>
> I think we could do better if this outer interpreter is hooked into the
> interpreter and compiler hooks of Gforth, so that the switching over can
> be
> seamlessly achieved while interpreting a file, and a single include file
> can load everything.

Yes, that would definitely be an advantage. On the other hand, those hooks
are not portable, and the result would be something like "StrongForth for
GForth". Portability was one of my main goals, because I didn't want to
maintain a separate version for each host.

StrongForth.f does not only have its own interpreter and dictionary. It
can't even use the host systems parsing mechanisms, because I didn't find a
way to portably reimplement INCLUDED and EVALUATE in such a way that they
use StrongForth's interpreter instead of the host's interpreter. As a
result, I had to reimplement SOURCE. PARSE, REFILL and all parsing words.

Regards,
Stephan


Bernd Paysan

unread,
Sep 30, 2008, 9:14:38 AM9/30/08
to
Stephan Becher wrote:
> Yes, that would definitely be an advantage. On the other hand, those hooks
> are not portable, and the result would be something like "StrongForth for
> GForth". Portability was one of my main goals, because I didn't want to
> maintain a separate version for each host.
>
> StrongForth.f does not only have its own interpreter and dictionary. It
> can't even use the host systems parsing mechanisms, because I didn't find
> a way to portably reimplement INCLUDED and EVALUATE in such a way that
> they use StrongForth's interpreter instead of the host's interpreter. As a
> result, I had to reimplement SOURCE. PARSE, REFILL and all parsing words.

We had some discussions about hooks on the last EuroForth (including
Forth200x meeting). Extensions like StrongForth and Manfred Mahlow's
prelude concept are a driving force to get more portable hooks (the systems
already contain hooks, but all differently).

As far as there's no good showcase how you can benefit from hooks, the major
vendors will oppose them.

Gerry

unread,
Sep 30, 2008, 1:14:14 PM9/30/08
to
On 29 Sep, 07:53, "Stephan Becher" <stephan.remove-this.bec...@t-

I've tried StrongForth with my system, which I like to think is
ANS compliant, and it crashed on loading :-(

I think I've traced the problem to where MESSAGE,( is executed.
This has a call via PARSE to your redefinition of SOURCE, which
in turn reads your value SOURCE-ID which is set to 0. This
causes TIB and #TIB to be accessed to get the ( c-addr u ) of
the input buffer which is a file input buffer, not a terminal
input buffer. Now when including a file my system does not set
TIB and #TIB to the file input buffer and I can't find any
requirement in ANS Forth to do so.

However GForth 0.6.2 seems to do this and so it works OK. I
don't know about SwiftForth.

Is it an ANS requirement to set TIB and #TIB when including a
forth source file? If not this is a portability problem. It's a
pity that TIB and #TIB are being used anyway as they are flagged
as obsolescent.

Apologies if I've misunderstood things completely.

Gerry

Doug Hoffman

unread,
Sep 30, 2008, 3:38:49 PM9/30/08
to
Bernd Paysan wrote:

> We had some discussions about hooks on the last EuroForth (including
> Forth200x meeting). Extensions like StrongForth and Manfred Mahlow's
> prelude concept are a driving force to get more portable hooks (the systems
> already contain hooks, but all differently).

Agreed. Those hooks, standardized, sound like a very good idea. I
would also like to see a standardized "unknown word" hook in the
interpreter and standardized hooks to recognize words that are a local
or a value. There are likely other hooks that if standardized would be
useful for writing portable extensions.

-Doug

sp...@controlq.com

unread,
Sep 30, 2008, 4:53:34 PM9/30/08
to

Wasn't this done once upon a time (FIG?) by using 'vectored' words ...
like KEY, ?KEY and PARSE ... or at least allowing the user to link into
the interpreter directly??

Just wondering,
Rob Sciuk
---- Posted via Pronews.com - Premium Corporate Usenet News Provider ----
http://www.pronews.com offers corporate packages that have access to 100,000+ newsgroups

Elizabeth D Rather

unread,
Sep 30, 2008, 4:57:42 PM9/30/08
to
sp...@controlq.com wrote:
> On Tue, 30 Sep 2008, Doug Hoffman wrote:
>> Bernd Paysan wrote:
>>
>>> We had some discussions about hooks on the last EuroForth (including
>>> Forth200x meeting). Extensions like StrongForth and Manfred Mahlow's
>>> prelude concept are a driving force to get more portable hooks (the
>>> systems
>>> already contain hooks, but all differently).
>>
>> Agreed. Those hooks, standardized, sound like a very good idea. I
>> would also like to see a standardized "unknown word" hook in the
>> interpreter and standardized hooks to recognize words that are a local
>> or a value. There are likely other hooks that if standardized would
>> be useful for writing portable extensions.
>>
>> -Doug
>
> Wasn't this done once upon a time (FIG?) by using 'vectored' words ...
> like KEY, ?KEY and PARSE ... or at least allowing the user to link into
> the interpreter directly??
>
> Just wondering,
> Rob Sciuk

Most implementations have done this since the dawn of time, but although
there's common usage for some of the vectors, such vectors have never
been standardized as to their existence and names.

Cheers,
Elizabeth

--
==================================================
Elizabeth D. Rather (US & Canada) 800-55-FORTH
FORTH Inc. +1 310.999.6784
5959 West Century Blvd. Suite 700
Los Angeles, CA 90045
http://www.forth.com

"Forth-based products and Services for real-time
applications since 1973."
==================================================

Coos Haak

unread,
Sep 30, 2008, 6:45:44 PM9/30/08
to
Op Tue, 30 Sep 2008 10:14:14 -0700 (PDT) schreef Gerry:

> On 29 Sep, 07:53, "Stephan Becher" <stephan.remove-this.bec...@t-
> online.de> wrote:

>> [19 citaatregels onderdrukt]


>
> I've tried StrongForth with my system, which I like to think is
> ANS compliant, and it crashed on loading :-(
>
> I think I've traced the problem to where MESSAGE,( is executed.
> This has a call via PARSE to your redefinition of SOURCE, which
> in turn reads your value SOURCE-ID which is set to 0. This
> causes TIB and #TIB to be accessed to get the ( c-addr u ) of
> the input buffer which is a file input buffer, not a terminal
> input buffer. Now when including a file my system does not set
> TIB and #TIB to the file input buffer and I can't find any
> requirement in ANS Forth to do so.
>
> However GForth 0.6.2 seems to do this and so it works OK. I
> don't know about SwiftForth.
>
> Is it an ANS requirement to set TIB and #TIB when including a
> forth source file? If not this is a portability problem. It's a
> pity that TIB and #TIB are being used anyway as they are flagged
> as obsolescent.
>
> Apologies if I've misunderstood things completely.
>
> Gerry

I encountered the same problem. My TIB refuses access when SOURCE-ID is
different from 0. My understanding is that reading from a file or a block,
the terminal is not the input source. So I'm not acting against the
standard, am I?. To load strong.f I had to redefine TIB and #TIB.

--
Coos

CHForth, 16 bit DOS applications
http://home.hccnet.nl/j.j.haak/forth.html

Stephan Becher

unread,
Oct 1, 2008, 3:56:10 AM10/1/08
to
"Coos Haak" <chf...@hccnet.nl> schrieb im Newsbeitrag
news:191h4u4wunkdu$.10dxjllu5222f$.dlg@40tude.net...

I investigated the problem, and found out that it is rather severe. The
solution is not just using the correct parsing word in MESSAGE,( and
defining own versions of TIB and #TIB. I tried that and it failed miserably,
but at least it revealed the root of the problem.

StrongForth.f uses its own parsing mechanism with a redefined version of
SOURCE-ID, but on the other hand it still relies on the host system's
parsing words whenever a new word is being defined. The host system's
defining words CREATE, CONSTANT, VARIABLE, : and so on are actually
evaluated by the corresponding StrongForth words. So, even if StrongForth
interprets a file or a string, the host system's version of SOURCE-ID is
still zero. I don't know why this still works well in GForth AND SwiftForth,
which are the only two systems StrongForth has been validated with.

The reason why StrongForth uses its own parsing mechanism is that I found no
other way to implement EVALUATE and INCLUDE in a portable way. These words
have to save the current input source, change it, and finally restore it.
But ANS Forth doesn't provide means to perform these actions portably. Using
the host system's versions of EVALUATE and INCLUDE is not possible, because
they call the host system's interpreter instead of StrongForth's
interpreter.

Since I have no idea how to resolve this problem, the only thing I can do by
now is to withdraw my claim that StrongForth.f is a standard application. It
more or less accidentally runs on GForth and SwiftForth.

Regards,
Stephan


Gerry

unread,
Oct 1, 2008, 4:44:20 AM10/1/08
to
On 1 Oct, 08:56, "Stephan Becher" <stephan.remove-this.bec...@t-
online.de> wrote:
> "Coos Haak" <chfo...@hccnet.nl> schrieb im Newsbeitragnews:191h4u4wunkdu$.10dxjllu5222f$.dlg@40tude.net...
>

[...]

> I investigated the problem, and found out that it is rather severe. The
> solution is not just using the correct parsing word in MESSAGE,( and
> defining own versions of TIB and #TIB. I tried that and it failed miserably,
> but at least it revealed the root of the problem.
>
> StrongForth.f uses its own parsing mechanism with a redefined version of
> SOURCE-ID, but on the other hand it still relies on the host system's
> parsing words whenever a new word is being defined. The host system's
> defining words CREATE, CONSTANT, VARIABLE, : and so on are actually
> evaluated by the corresponding StrongForth words. So, even if StrongForth
> interprets a file or a string, the host system's version of SOURCE-ID is
> still zero. I don't know why this still works well in GForth AND SwiftForth,
> which are the only two systems StrongForth has been validated with.
>
> The reason why StrongForth uses its own parsing mechanism is that I found no
> other way to implement EVALUATE and INCLUDE in a portable way. These words
> have to save the current input source, change it, and finally restore it.
> But ANS Forth doesn't provide means to perform these actions portably. Using
> the host system's versions of EVALUATE and INCLUDE is not possible, because
> they call the host system's interpreter instead of StrongForth's
> interpreter.
>

There was a discussion about this sort of thing about two weeks
ago and I undertook to write an RfD for a word I've called
FILE-SOURCE which makes a file an input source but does not
invoke the text interpreter. Would such a word help to solve the
problem? It was pointed out that GForth has EXECUTE-PARSING and
EXECUTE-PARSING-FILE that are similar.

[...]

Gerry

Stephan Becher

unread,
Oct 1, 2008, 8:16:40 AM10/1/08
to
"Gerry" <ge...@jackson9000.fsnet.co.uk> schrieb im Newsbeitrag
news:514e9876-8aaa-42aa...@v15g2000hsa.googlegroups.com...

Yes, I found this thread pretty interesting. And I think the proposed ANS
extensions might help solving the problem, at least regarding INCLUDE.
However, none of these words is yet part of the standard. Therefore, I'm
still focused on finding a solution by keeping StrongForth's own parsing
mechanism, even though a solution where the host system's parsing mechanism
can directly be used seems to be much cleaner.

Regards,
Stephan


Josh Grams

unread,
Oct 1, 2008, 8:26:56 AM10/1/08
to
Stephan Becher wrote: <gbvaeq$dgq$03$1...@news.t-online.com>

> "Coos Haak" <chf...@hccnet.nl> schrieb im Newsbeitrag
> news:191h4u4wunkdu$.10dxjllu5222f$.dlg@40tude.net...
>> Op Tue, 30 Sep 2008 10:14:14 -0700 (PDT) schreef Gerry:
>>>
>>> I've tried StrongForth with my system, which I like to think is
>>> ANS compliant, and it crashed on loading :-(
>>>
>>> I think I've traced the problem to where MESSAGE,( is executed.
>>> This has a call via PARSE to your redefinition of SOURCE, which
>>> in turn reads your value SOURCE-ID which is set to 0. This
>>> causes TIB and #TIB to be accessed to get the ( c-addr u ) of
>>> the input buffer which is a file input buffer, not a terminal
>>> input buffer. Now when including a file my system does not set
>>> TIB and #TIB to the file input buffer and I can't find any
>>> requirement in ANS Forth to do so.
>>
>> I encountered the same problem. My TIB refuses access when SOURCE-ID is
>> different from 0. My understanding is that reading from a file or a block,
>> the terminal is not the input source. So I'm not acting against the
>> standard, am I?. To load strong.f I had to redefine TIB and #TIB.
>
> I investigated the problem, and found out that it is rather severe. The
> solution is not just using the correct parsing word in MESSAGE,( and
> defining own versions of TIB and #TIB. I tried that and it failed miserably,
> but at least it revealed the root of the problem.
>
> StrongForth.f uses its own parsing mechanism with a redefined version of
> SOURCE-ID, but on the other hand it still relies on the host system's
> parsing words whenever a new word is being defined. The host system's
> defining words CREATE, CONSTANT, VARIABLE, : and so on are actually
> evaluated by the corresponding StrongForth words. So, even if StrongForth
> interprets a file or a string, the host system's version of SOURCE-ID is
> still zero. I don't know why this still works well in GForth AND SwiftForth,
> which are the only two systems StrongForth has been validated with.

I think you're wrong. Well, that or I'm misunderstanding you.

The problem is that you're using your versions of the parsing words
interpretively in strong.f. But that input is coming from a file
(strong.f). So on Gforth and SwiftForth, which set TIB and #TIB even
for a file, your parsing words work OK (your SOURCE-ID hasn't been set
yet, so they fetch input from TIB/#TIB). On systems which only use
TIB/#TIB for keyboard input (or if you redefine TIB/#TIB), they fail.

So you need to save the host versions of PARSE and PARSE-WORD, and
define a second version of any word which is used interpretively in
strong.f which uses them, and then switch all interpretive uses to the
new version. So you'll need two versions of EXPORT and DICT-CREATE, and
to fix MESSAGE,( and EXPORT-DT (they need the host system's parsing, but
are not exported to StrongForth).

Here's a quick patch: I'm sure it could be done better, but it does work
for me (with redefined TIB/#TIB under gforth).

--Josh


--- strong.f 2008-10-01 08:11:59.000000000 -0400
+++ ../strongforth-1.0a/strong.f 2008-10-01 08:12:09.000000000 -0400
@@ -123,6 +123,8 @@
-1 CONSTANT STRING-ID
2VARIABLE SOURCE-SPEC

+CREATE TIB 80 CHARS ALLOT
+VARIABLE #TIB
CREATE FIB 1024 CHARS ALLOT
VARIABLE #FIB
CREATE STR 80 CHARS ALLOT
@@ -632,6 +634,8 @@
ELSE R> SWAP
THEN 4 ROLL DROP 3 ROLL -ROT ;

+: HOST-PARSE PARSE ;
+
: PARSE ( char -- c-addr u )
SOURCE >IN @ SWAP ENCLOSE >IN ! OVER - -ROT + SWAP ;

@@ -645,6 +649,8 @@
ELSE R> SWAP
THEN 3 ROLL -ROT ;

+: HOST-PARSE-WORD PARSE-WORD ;
+
: PARSE-WORD ( -- c-addr u )
SOURCE >IN @ SWAP ENCLOSE-WORD >IN ! OVER - -ROT + SWAP
DUP 31 > IF -19 THROW THEN ;
@@ -666,12 +672,21 @@
: DEFINE-WORD ( c-addr u -- xt )
?EXECUTE PREVIEW-WORD 2EVALUATE S" ' " PREVIEW-WORD 2EVALUATE ;

-: (CREATE) ( xt -- )
- DICT-HERE PARSE-WORD DICT-NAME, ( name field )
- DICT, ( link field )
+: HOST-PREVIEW-WORD ( -- c-addr u )
+ >IN @ HOST-PARSE-WORD ROT >IN ! ;
+
+: HOST-DEFINE-WORD ( c-addr u -- xt )
+ HOST-PREVIEW-WORD 2EVALUATE S" ' " HOST-PREVIEW-WORD 2EVALUATE ;
+
+: ((CREATE)) ( xt c-addr u -- )
+ DICT-HERE >R DICT-NAME, ( name field )
+ R> DICT, ( link field )
LATEST! DICT, ( token field )
IMMEDIATE-ATTRIBUTE DICT, ( attribute field ) ;

+: (CREATE) ( xt -- )
+ PARSE-WORD ((CREATE)) ;
+
: (CREATE-NONAME) ( xt -- )
LATEST! DICT, ( token field )
[ IMMEDIATE-ATTRIBUTE NONAME-ATTRIBUTE OR ] LITERAL
@@ -680,15 +695,21 @@
: +ATTRIBUTE ( x -- )
LATEST CELL+ +! ;

+: HOST-EXPORT ( xt -- )
+ HOST-PARSE-WORD ((CREATE)) END-DEF ;
+
: EXPORT ( xt -- )
(CREATE) END-DEF ;

: EXPORT-DT ( xt -- )
- EXPORT DATA-TYPE-ATTRIBUTE +ATTRIBUTE ;
+ HOST-EXPORT DATA-TYPE-ATTRIBUTE +ATTRIBUTE ;

: DICT-CREATE ( -- )
S" CREATE " DEFINE-WORD EXPORT ;

+: HOST-DICT-CREATE ( -- )
+ S" CREATE " HOST-DEFINE-WORD HOST-EXPORT ;
+
: DICT-CODE ( -- )
S" CODE " DEFINE-WORD (CREATE) ;

@@ -1473,7 +1494,7 @@

: MESSAGE,( ( n -- )
HERE ERROR-MESSAGES ROT CELLS+ !
- [CHAR] ) PARSE DUP C, HERE SWAP DUP CHARS ALLOT CMOVE ;
+ [CHAR] ) HOST-PARSE DUP C, HERE SWAP DUP CHARS ALLOT CMOVE ;

1 MESSAGE,( ABORT)
2 MESSAGE,( ABORT")
@@ -1636,307 +1657,307 @@
: ( ( -- flag sd )
STATE @ POSTPONE [ DT-INPUT ;

-' DUP EXPORT DUP ( SINGLE -- 1ST 1ST )
-' 2DUP EXPORT DUP ( DOUBLE -- 1ST 1ST )
-' DROP EXPORT DROP ( SINGLE -- )
-' 2DROP EXPORT DROP ( DOUBLE -- )
-' SWAP EXPORT SWAP ( SINGLE SINGLE -- 2ND 1ST )
-' ROT EXPORT SWAP ( SINGLE DOUBLE -- 2ND 1ST )
-' -ROT EXPORT SWAP ( DOUBLE SINGLE -- 2ND 1ST )
-' 2SWAP EXPORT SWAP ( DOUBLE DOUBLE -- 2ND 1ST )
-' OVER EXPORT OVER ( SINGLE SINGLE -- 1ST 2ND 1ST )
-' OVER-SD EXPORT OVER ( SINGLE DOUBLE -- 1ST 2ND 1ST )
-' OVER-DS EXPORT OVER ( DOUBLE SINGLE -- 1ST 2ND 1ST )
-' 2OVER EXPORT OVER ( DOUBLE DOUBLE -- 1ST 2ND 1ST )
-' NIP EXPORT NIP ( SINGLE SINGLE -- 2ND )
-' NIP-SD EXPORT NIP ( SINGLE DOUBLE -- 2ND )
-' NIP-DS EXPORT NIP ( DOUBLE SINGLE -- 2ND )
-' 2NIP EXPORT NIP ( DOUBLE DOUBLE -- 2ND )
-' TUCK EXPORT TUCK ( SINGLE SINGLE -- 2ND 1ST 2ND )
-' TUCK-SD EXPORT TUCK ( SINGLE DOUBLE -- 2ND 1ST 2ND )
-' TUCK-DS EXPORT TUCK ( DOUBLE SINGLE -- 2ND 1ST 2ND )
-' 2TUCK EXPORT TUCK ( DOUBLE DOUBLE -- 2ND 1ST 2ND )
-' ROT EXPORT ROT ( SINGLE SINGLE SINGLE -- 2ND 3RD 1ST )
-' ROT-SSD EXPORT ROT ( SINGLE SINGLE DOUBLE -- 2ND 3RD 1ST )
-' ROT-SSD EXPORT ROT ( SINGLE DOUBLE SINGLE -- 2ND 3RD 1ST )
-' ROT-SDD EXPORT ROT ( SINGLE DOUBLE DOUBLE -- 2ND 3RD 1ST )
-' 2SWAP EXPORT ROT ( DOUBLE SINGLE SINGLE -- 2ND 3RD 1ST )
-' ROT-DSD EXPORT ROT ( DOUBLE SINGLE DOUBLE -- 2ND 3RD 1ST )
-' ROT-DSD EXPORT ROT ( DOUBLE DOUBLE SINGLE -- 2ND 3RD 1ST )
-' 2ROT EXPORT ROT ( DOUBLE DOUBLE DOUBLE -- 2ND 3RD 1ST )
-' FALSE EXPORT S>D ( SINGLE -- DOUBLE )
-' S>D EXPORT S>D ( SIGNED -- SIGNED-DOUBLE )
-' D>S EXPORT D>S ( DOUBLE -- SINGLE )
-' NOOP EXPORT SPLIT ( DOUBLE -- SINGLE SINGLE )
-' NOOP EXPORT MERGE ( SINGLE SINGLE -- DOUBLE )
-' ! EXPORT ! ( SINGLE ADDRESS -> 1ST -- )
-' 2! EXPORT ! ( DOUBLE ADDRESS -> 1ST -- )
-' C! EXPORT ! ( SINGLE CADDRESS -> 1ST -- )
-' @ EXPORT @ ( ADDRESS -> SINGLE -- 2ND )
-' 2@ EXPORT @ ( ADDRESS -> DOUBLE -- 2ND )
-' C@ EXPORT @ ( CADDRESS -> SINGLE -- 2ND )
-' C@EXT EXPORT @ ( CADDRESS -> SIGNED -- 2ND )
-' C@EXT EXPORT @ ( CADDRESS -> FLAG -- 2ND )
-' FILL-S EXPORT FILL ( ADDRESS -> SINGLE UNSIGNED 2ND -- )
-' FILL-D EXPORT FILL ( ADDRESS -> DOUBLE UNSIGNED 2ND -- )
-' FILL EXPORT FILL ( CADDRESS -> SINGLE UNSIGNED 2ND -- )
-' ERASE-S EXPORT ERASE ( ADDRESS -> SINGLE UNSIGNED -- )
-' ERASE-D EXPORT ERASE ( ADDRESS -> DOUBLE UNSIGNED -- )
-' ERASE-C EXPORT ERASE ( CADDRESS -> SINGLE UNSIGNED -- )
-' BLANK EXPORT BLANK ( CADDRESS -> CHARACTER UNSIGNED -- )
-' MOVE-S EXPORT MOVE ( ADDRESS -> SINGLE ADDRESS -> 2ND UNSIGNED -- )
-' MOVE-D EXPORT MOVE ( ADDRESS -> DOUBLE ADDRESS -> 2ND UNSIGNED -- )
-' MOVE-C EXPORT MOVE ( CADDRESS -> SINGLE CADDRESS -> 2ND UNSIGNED -- )
-' SEARCH EXPORT SEARCH ( CADDRESS -> CHARACTER UNSIGNED 1ST 3RD -- 1ST 3RD FLAG )
-' PAD EXPORT PAD ( -- CADDRESS -> CHARACTER )
-' + EXPORT + ( INTEGER INTEGER -- 1ST )
-' + EXPORT + ( ADDRESS INTEGER -- 1ST )
-' CELLS+ EXPORT + ( ADDRESS -> SINGLE INTEGER -- 1ST )
-' DCELLS+ EXPORT + ( ADDRESS -> DOUBLE INTEGER -- 1ST )
-' CHARS+ EXPORT + ( CADDRESS INTEGER -- 1ST )
-' D+ EXPORT + ( INTEGER-DOUBLE INTEGER-DOUBLE -- 1ST )
-' UM+ EXPORT + ( INTEGER-DOUBLE INTEGER -- 1ST )
-' M+ EXPORT + ( INTEGER-DOUBLE SIGNED -- 1ST )
-' - EXPORT - ( INTEGER INTEGER -- 1ST )
-' - EXPORT - ( ADDRESS INTEGER -- 1ST )
-' CELLS- EXPORT - ( ADDRESS -> SINGLE INTEGER -- 1ST )
-' DCELLS- EXPORT - ( ADDRESS -> DOUBLE INTEGER -- 1ST )
-' CHARS- EXPORT - ( CADDRESS INTEGER -- 1ST )
-' D- EXPORT - ( INTEGER-DOUBLE INTEGER-DOUBLE -- 1ST )
-' UM- EXPORT - ( INTEGER-DOUBLE INTEGER -- 1ST )
-' M- EXPORT - ( INTEGER-DOUBLE SIGNED -- 1ST )
-' - EXPORT - ( ADDRESS 1ST -- SIGNED )
-' -S EXPORT - ( ADDRESS -> SINGLE 1ST -- SIGNED )
-' -D EXPORT - ( ADDRESS -> DOUBLE 1ST -- SIGNED )
-' -C EXPORT - ( CADDRESS 1ST -- SIGNED )
-' 1+ EXPORT 1+ ( INTEGER -- 1ST )
-' 1+ EXPORT 1+ ( ADDRESS -- 1ST )
-' CELL+ EXPORT 1+ ( ADDRESS -> SINGLE -- 1ST )
-' 2CELLS+ EXPORT 1+ ( ADDRESS -> DOUBLE -- 1ST )
-' CHAR+ EXPORT 1+ ( CADDRESS -- 1ST )
-' D1+ EXPORT 1+ ( INTEGER-DOUBLE -- 1ST )
-' 1- EXPORT 1- ( INTEGER -- 1ST )
-' 1- EXPORT 1- ( ADDRESS -- 1ST )
-' CELL- EXPORT 1- ( ADDRESS -> SINGLE -- 1ST )
-' 2CELLS- EXPORT 1- ( ADDRESS -> DOUBLE -- 1ST )
-' CHAR- EXPORT 1- ( CADDRESS -- 1ST )
-' D1- EXPORT 1- ( INTEGER-DOUBLE -- 1ST )
-' +! EXPORT +! ( INTEGER ADDRESS -> INTEGER -- )
-' D+! EXPORT +! ( INTEGER-DOUBLE ADDRESS -> INTEGER-DOUBLE -- )
-' UM+! EXPORT +! ( INTEGER ADDRESS -> INTEGER-DOUBLE -- )
-' M+! EXPORT +! ( SIGNED ADDRESS -> INTEGER-DOUBLE -- )
-' C+! EXPORT +! ( INTEGER CADDRESS -> INTEGER -- )
-' +! EXPORT +! ( INTEGER ADDRESS -> ADDRESS -- )
-' +!-S EXPORT +! ( INTEGER ADDRESS -> ADDRESS -> SINGLE -- )
-' +!-D EXPORT +! ( INTEGER ADDRESS -> ADDRESS -> DOUBLE -- )
-' +!-C EXPORT +! ( INTEGER ADDRESS -> CADDRESS -- )
-' * EXPORT * ( INTEGER UNSIGNED -- 1ST )
-' * EXPORT * ( SIGNED SIGNED -- 1ST )
-' TM* EXPORT * ( INTEGER-DOUBLE UNSIGNED -- 1ST )
-' UM* EXPORT M* ( UNSIGNED UNSIGNED -- UNSIGNED-DOUBLE )
-' M* EXPORT M* ( SIGNED SIGNED -- SIGNED-DOUBLE )
-' U/ EXPORT / ( UNSIGNED UNSIGNED -- 1ST )
-' / EXPORT / ( SIGNED SIGNED -- 1ST )
-' M/ EXPORT / ( UNSIGNED-DOUBLE UNSIGNED -- 1ST )
-' UMOD EXPORT MOD ( UNSIGNED UNSIGNED -- 2ND )
-' MOD EXPORT MOD ( SIGNED SIGNED -- 2ND )
-' UMMOD EXPORT MOD ( UNSIGNED-DOUBLE UNSIGNED -- 2ND )
-' U/MOD EXPORT /MOD ( UNSIGNED UNSIGNED -- 2ND 1ST )
-' /MOD EXPORT /MOD ( SIGNED SIGNED -- 2ND 1ST )
-' TM/MOD EXPORT /MOD ( UNSIGNED-DOUBLE UNSIGNED -- 2ND 1ST )
-' U*/ EXPORT */ ( UNSIGNED UNSIGNED UNSIGNED -- 1ST )
-' */ EXPORT */ ( SIGNED SIGNED SIGNED -- 1ST )
-' M*/ EXPORT */ ( UNSIGNED-DOUBLE UNSIGNED UNSIGNED -- 1ST )
-' U*/MOD EXPORT */MOD ( UNSIGNED UNSIGNED UNSIGNED -- 3RD 1ST )
-' */MOD EXPORT */MOD ( SIGNED SIGNED SIGNED -- 3RD 1ST )
-' TM*/MOD EXPORT */MOD ( UNSIGNED-DOUBLE UNSIGNED UNSIGNED -- 3RD 1ST )
-' FM/MOD EXPORT FM/MOD ( SIGNED-DOUBLE SIGNED -- 2ND SIGNED )
-' SM/REM EXPORT SM/REM ( SIGNED-DOUBLE SIGNED -- 2ND SIGNED )
-' UM/MOD EXPORT UM/MOD ( UNSIGNED-DOUBLE UNSIGNED -- 2ND UNSIGNED )
-' 2* EXPORT 2* ( INTEGER -- 1ST )
-' D2* EXPORT 2* ( INTEGER-DOUBLE -- 1ST )
-' U2/ EXPORT 2/ ( UNSIGNED -- 1ST )
-' 2/ EXPORT 2/ ( SIGNED -- 1ST )
-' DU2/ EXPORT 2/ ( UNSIGNED-DOUBLE -- 1ST )
-' D2/ EXPORT 2/ ( SIGNED-DOUBLE -- 1ST )
-' ABS EXPORT ABS ( SIGNED -- 1ST )
-' DABS EXPORT ABS ( SIGNED-DOUBLE -- 1ST )
-' NEGATE EXPORT NEGATE ( INTEGER -- 1ST )
-' DNEGATE EXPORT NEGATE ( INTEGER-DOUBLE -- 1ST )
-' UMIN EXPORT MIN ( INTEGER 1ST -- 1ST )
-' MIN EXPORT MIN ( SIGNED 1ST -- 1ST )
-' UMIN EXPORT MIN ( ADDRESS 1ST -- 1ST )
-' DUMIN EXPORT MIN ( INTEGER-DOUBLE 1ST -- 1ST )
-' DMIN EXPORT MIN ( SIGNED-DOUBLE 1ST -- 1ST )
-' UMAX EXPORT MAX ( INTEGER 1ST -- 1ST )
-' MAX EXPORT MAX ( SIGNED 1ST -- 1ST )
-' UMAX EXPORT MAX ( ADDRESS 1ST -- 1ST )
-' DUMAX EXPORT MAX ( INTEGER-DOUBLE 1ST -- 1ST )
-' DMAX EXPORT MAX ( SIGNED-DOUBLE 1ST -- 1ST )
-' U< EXPORT < ( INTEGER 1ST -- FLAG )
-' < EXPORT < ( SIGNED 1ST -- FLAG )
-' U< EXPORT < ( ADDRESS 1ST -- FLAG )
-' DU< EXPORT < ( INTEGER-DOUBLE 1ST -- FLAG )
-' D< EXPORT < ( SIGNED-DOUBLE 1ST -- FLAG )
-' U> EXPORT > ( INTEGER 1ST -- FLAG )
-' > EXPORT > ( SIGNED 1ST -- FLAG )
-' U> EXPORT > ( ADDRESS 1ST -- FLAG )
-' DU> EXPORT > ( INTEGER-DOUBLE 1ST -- FLAG )
-' D> EXPORT > ( SIGNED-DOUBLE 1ST -- FLAG )
-' = EXPORT = ( SINGLE 1ST -- FLAG )
-' D= EXPORT = ( DOUBLE 1ST -- FLAG )
-' <> EXPORT <> ( SINGLE 1ST -- FLAG )
-' D<> EXPORT <> ( DOUBLE 1ST -- FLAG )
-' 0< EXPORT 0< ( SIGNED -- FLAG )
-' D0< EXPORT 0< ( SIGNED-DOUBLE -- FLAG )
-' 0> EXPORT 0> ( SIGNED -- FLAG )
-' D0> EXPORT 0> ( SIGNED-DOUBLE -- FLAG )
-' 0= EXPORT 0= ( SINGLE -- FLAG )
-' D0= EXPORT 0= ( DOUBLE -- FLAG )
-' 0<> EXPORT 0<> ( SINGLE -- FLAG )
-' D0<> EXPORT 0<> ( DOUBLE -- FLAG )
-' WITHIN EXPORT WITHIN ( INTEGER 1ST 1ST -- FLAG )
-' WITHIN EXPORT WITHIN ( ADDRESS 1ST 1ST -- FLAG )
-' AND EXPORT AND ( SINGLE LOGICAL -- 1ST )
-' OR EXPORT OR ( SINGLE LOGICAL -- 1ST )
-' XOR EXPORT XOR ( SINGLE LOGICAL -- 1ST )
-' INVERT EXPORT INVERT ( LOGICAL -- 1ST )
-' 2* EXPORT LSHIFT ( LOGICAL -- 1ST )
-' LSHIFT EXPORT LSHIFT ( LOGICAL UNSIGNED -- 1ST )
-' U2/ EXPORT RSHIFT ( LOGICAL -- 1ST )
-' RSHIFT EXPORT RSHIFT ( LOGICAL UNSIGNED -- 1ST )
-' /STRING EXPORT /STRING ( CADDRESS -> CHARACTER UNSIGNED INTEGER -- 1ST 3RD )
-' 1/STRING EXPORT /STRING ( CADDRESS -> CHARACTER UNSIGNED -- 1ST 3RD )
-' HERE EXPORT HERE ( -- ADDRESS )
-' ALIGN EXPORT ALIGN ( -- )
-' ALIGNED EXPORT ALIGNED ( ADDRESS -- 1ST )
-' , EXPORT , ( SINGLE -- )
-' 2, EXPORT , ( DOUBLE -- )
-' C, EXPORT C, ( SINGLE -- )
-' ALLOT EXPORT ALLOT ( INTEGER -- )
-' UNUSED EXPORT UNUSED ( -- UNSIGNED )
-' DICT-HERE EXPORT DICT-HERE ( -- ADDRESS )
-' DICT, EXPORT DICT, ( SINGLE -- )
-' 2DICT, EXPORT DICT, ( DOUBLE -- )
-' DICT-ALLOT EXPORT DICT-ALLOT ( INTEGER -- )
-' DICT-ALIGN EXPORT DICT-ALIGN ( -- )
-' DICT-NAME, EXPORT DICT-NAME, ( CADDRESS -> CHARACTER UNSIGNED -- )
-' CHARS EXPORT CHARS ( INTEGER -- 1ST )
-' CELLS EXPORT CELLS ( INTEGER -- 1ST )
-' KEY EXPORT KEY ( -- CHARACTER )
-' ACCEPT EXPORT ACCEPT ( CADDRESS -> CHARACTER INTEGER -- 3RD )
-' EMIT EXPORT EMIT ( INTEGER -- )
-' TYPE EXPORT TYPE ( CADDRESS -> CHARACTER UNSIGNED -- )
-' COMPARE EXPORT COMPARE ( CADDRESS -> CHARACTER UNSIGNED 1ST 3RD -- SIGNED )
-' NOOP EXPORT NOOP ( -- )
-' TRUE EXPORT TRUE ( -- FLAG )
-' FALSE EXPORT FALSE ( -- FLAG )
-' CR EXPORT CR ( -- )
-' BL EXPORT BL ( -- CHARACTER )
-' BASE EXPORT BASE ( -- ADDRESS -> UNSIGNED )
-' >R EXPORT (>R) ( SINGLE -- )
-' 2>R EXPORT (>R) ( DOUBLE -- )
-' RDROP EXPORT (RDROP) ( -- ) IMMEDIATE
-' DRDROP EXPORT (DRDROP) ( -- ) IMMEDIATE
-' DT-PREFIX EXPORT DT-PREFIX ( -- DATA-TYPE )
-' DT-INPUT EXPORT DT-INPUT ( -- DATA-TYPE )
-' DT-OUTPUT EXPORT DT-OUTPUT ( -- DATA-TYPE )
-' DT-OFFSET EXPORT DT-OFFSET ( -- DATA-TYPE )
-' DT-AND EXPORT AND ( DATA-TYPE DATA-TYPE -- 1ST )
-' DT-OR EXPORT OR ( DATA-TYPE DATA-TYPE -- 1ST )
-' DT-XOR EXPORT XOR ( DATA-TYPE DATA-TYPE -- 1ST )
-' DT-INVERT EXPORT INVERT ( DATA-TYPE -- 1ST )
-' DT-ATTRIBUTE? EXPORT ATTRIBUTE? ( DATA-TYPE DATA-TYPE -- FLAG )
-' DT-NULL? EXPORT NULL? ( DATA-TYPE -- FLAG )
-' OFFSET EXPORT OFFSET ( DATA-TYPE -- UNSIGNED )
-' OFFSET+ EXPORT OFFSET+ ( DATA-TYPE INTEGER -- 1ST )
-' FALSE EXPORT NEW-TUPLE ( -- TUPLE )
-' T> EXPORT T> ( TUPLE -> SINGLE -- 1ST 2ND )
-' 2T> EXPORT T> ( TUPLE -> DOUBLE -- 1ST 2ND )
-' >T EXPORT >T ( TUPLE -> SINGLE 2ND -- 1ST )
-' 2>T EXPORT >T ( TUPLE -> DOUBLE 2ND -- 1ST )
-' TDROP EXPORT DROP ( TUPLE -- )
-' DUP EXPORT SIZE ( TUPLE -- 1ST UNSIGNED )
-' DTP@ EXPORT DTP@ ( -- ADDRESS -> DATA-TYPE )
-' DTP! EXPORT DTP! ( -- )
-' DTP| EXPORT DTP| ( -- )
-' >DT EXPORT >DT ( DATA-TYPE -- )
-' DT> EXPORT DT> ( -- DATA-TYPE FLAG )
-' DT-DEPTH EXPORT DEPTH ( -- UNSIGNED )
-' PARAM, EXPORT PARAM, ( STACK-DIAGRAM DATA-TYPE -- 1ST )
-' (PARAM) EXPORT (PARAM) ( STACK-DIAGRAM DATA-TYPE -- 1ST )
-' -- EXPORT -- ( STACK-DIAGRAM -- 1ST )
-' DT-> EXPORT -> ( -- ) IMMEDIATE
-' -> EXPORT -> ( STACK-DIAGRAM -- 1ST )
-' TH EXPORT TH ( STACK-DIAGRAM UNSIGNED -- 1ST )
-' ( EXPORT ( ( -- FLAG STACK-DIAGRAM ) IMMEDIATE
-' STATE! EXPORT STATE! ( SINGLE -- )
-' <DIAGRAM EXPORT <DIAGRAM ( FLAG STACK-DIAGRAM -- 2ND )
-' DIAGRAM> EXPORT DIAGRAM> ( STACK-DIAGRAM -- )
-' ENCLOSE-DIAGRAM EXPORT ENCLOSE-DIAGRAM ( STACK-DIAGRAM -- 1ST ADDRESS -> DATA-TYPE ADDRESS -> DATA-TYPE )
-' 2CELLS+ EXPORT PARAMS ( DEFINITION -- ADDRESS -> DATA-TYPE )
-' PARAM@ EXPORT PARAM@ ( DEFINITION UNSIGNED -- DATA-TYPE )
-' END-DIAGRAM EXPORT END-DIAGRAM ( STACK-DIAGRAM -- )
-' PARAMS>DT EXPORT PARAMS>DT ( DEFINITION DATA-TYPE -- )
-' ALL-PARAMS>DT EXPORT ALL-PARAMS>DT ( DEFINITION UNSIGNED -- 1ST )
-' ) EXPORT ) ( FLAG STACK-DIAGRAM -- )
-' )COLON EXPORT ) ( COLON-SYS FLAG STACK-DIAGRAM -- 1ST )
-' FORTH-WID EXPORT FORTH-WORDLIST ( -- WID )
-' LOCAL-WID EXPORT LOCAL-WORDLIST ( -- WID )
-' ENVIRONMENT-WID EXPORT ENVIRONMENT-WORDLIST ( -- WID )
-' GET-CURRENT EXPORT GET-CURRENT ( -- WID )
-' SET-CURRENT EXPORT SET-CURRENT ( WID -- )
-' LATEST EXPORT LATEST ( -- DEFINITION ) VALUE-ATTRIBUTE +ATTRIBUTE
-' LATEST! EXPORT LATEST! ( -- )
-' NONAME? EXPORT NONAME? ( DEFINITION -- FLAG )
-' ?NONAME EXPORT ?NONAME ( DEFINITION -- )
-' NAME EXPORT NAME ( DEFINITION -- CADDRESS -> CHARACTER UNSIGNED )
-' END-DEF EXPORT END-DEF ( -- )
-' (CREATE) EXPORT (CREATE) ( TOKEN -- )
-' (CREATE-NONAME) EXPORT (CREATE-NONAME) ( TOKEN -- )
-' DICT-CREATE EXPORT CREATE ( -- )
-' DICT-CODE EXPORT CODE ( -- )
-' #PARAMS EXPORT #PARAMS ( DEFINITION -- UNSIGNED )
-' @ EXPORT >TOKEN ( DEFINITION -- TOKEN )
-' DICT>BODY EXPORT >BODY ( DEFINITION -- ADDRESS )
-' SEARCH-WID EXPORT SEARCH ( CADDRESS -> CHARACTER UNSIGNED SINGLE TOKEN WID -- DEFINITION SIGNED )
-' SEARCH-ALL EXPORT SEARCH-ALL ( CADDRESS -> CHARACTER UNSIGNED SINGLE TOKEN -- DEFINITION SIGNED )
-' ?DATA-TYPE EXPORT ?DATA-TYPE ( DEFINITION -- DATA-TYPE )
-' DT EXPORT DT ( -- DATA-TYPE )
-' PARENT EXPORT PARENT ( DATA-TYPE -- 1ST )
-' ANCESTOR EXPORT ANCESTOR ( DATA-TYPE -- 1ST )
-' DT-SIZE EXPORT SIZE ( DATA-TYPE -- UNSIGNED )
-' ?DT-SIZE EXPORT ?SIZE ( DATA-TYPE -- UNSIGNED )
-' DEPTH-SP EXPORT DEPTH-SP ( -- UNSIGNED )
-' DTDROP EXPORT DTDROP ( -- DATA-TYPE )
-' STATE EXPORT STATE ( -- ADDRESS -> FLAG )
-' [ EXPORT [ ( -- ) IMMEDIATE
-' ] EXPORT ] ( -- )
-' CAST EXPORT CAST ( -- ) IMMEDIATE
-' ?COMPILE EXPORT ?COMPILE ( -- )
-' ?EXECUTE EXPORT ?EXECUTE ( -- )
-' TOKEN-FIELD EXPORT TOKEN-FIELD ( SIGNED DEFINITION SINGLE -- 1ST )
-' ATTRIBUTE-FIELD EXPORT ATTRIBUTE-FIELD ( SIGNED DEFINITION SINGLE -- 1ST )
-' 2DROP EXPORT ONLY-NAME ( SIGNED DEFINITION SINGLE -- 1ST )
-' DICT: EXPORT : ( -- COLON-SYS )
-' DICT:NONAME EXPORT :NONAME ( -- DEFINITION COLON-SYS )
-' ?PARAMS EXPORT ?PARAMS ( -- )
-' DICT-EXIT EXPORT EXIT ( -- ) IMMEDIATE
-' DICT; EXPORT ; ( COLON-SYS -- ) IMMEDIATE
-' DOES; EXPORT ; ( DOES-SYS -- ) IMMEDIATE
-:NONAME POSTPONE LITERAL ; EXPORT LITERAL, ( SINGLE -- )
-:NONAME POSTPONE 2LITERAL ; EXPORT LITERAL, ( DOUBLE -- )
-' @>DT EXPORT @>DT ( ADDRESS -> DATA-TYPE -- )
-' <LOCALS EXPORT <LOCALS ( -- )
-' LOCALS> EXPORT LOCALS> ( -- )
-' DICT-COMPILE, EXPORT COMPILE, ( DEFINITION -- )
-' (CAST) EXPORT (CAST) ( ADDRESS -> DATA-TYPE UNSIGNED FLAG -- )
-' DT>DT EXPORT DT>DT ( DEFINITION FLAG -- TOKEN )
-' ?CONGRUENT EXPORT ?CONGRUENT ( DEFINITION ADDRESS -> DATA-TYPE -- )
-' IDENTITY EXPORT IDENTITY ( SIGNED DEFINITION SINGLE -- 1ST )
-' DEFERRED EXPORT DEFERRED ( SIGNED DEFINITION SINGLE -- 1ST )
-' MATCH EXPORT MATCH ( SIGNED DEFINITION SINGLE -- 1ST )
-' ?DT>DT EXPORT ?DT>DT ( CADDRESS -> CHARACTER UNSIGNED -- TOKEN )
+' DUP HOST-EXPORT DUP ( SINGLE -- 1ST 1ST )
+' 2DUP HOST-EXPORT DUP ( DOUBLE -- 1ST 1ST )
+' DROP HOST-EXPORT DROP ( SINGLE -- )
+' 2DROP HOST-EXPORT DROP ( DOUBLE -- )
+' SWAP HOST-EXPORT SWAP ( SINGLE SINGLE -- 2ND 1ST )
+' ROT HOST-EXPORT SWAP ( SINGLE DOUBLE -- 2ND 1ST )
+' -ROT HOST-EXPORT SWAP ( DOUBLE SINGLE -- 2ND 1ST )
+' 2SWAP HOST-EXPORT SWAP ( DOUBLE DOUBLE -- 2ND 1ST )
+' OVER HOST-EXPORT OVER ( SINGLE SINGLE -- 1ST 2ND 1ST )
+' OVER-SD HOST-EXPORT OVER ( SINGLE DOUBLE -- 1ST 2ND 1ST )
+' OVER-DS HOST-EXPORT OVER ( DOUBLE SINGLE -- 1ST 2ND 1ST )
+' 2OVER HOST-EXPORT OVER ( DOUBLE DOUBLE -- 1ST 2ND 1ST )
+' NIP HOST-EXPORT NIP ( SINGLE SINGLE -- 2ND )
+' NIP-SD HOST-EXPORT NIP ( SINGLE DOUBLE -- 2ND )
+' NIP-DS HOST-EXPORT NIP ( DOUBLE SINGLE -- 2ND )
+' 2NIP HOST-EXPORT NIP ( DOUBLE DOUBLE -- 2ND )
+' TUCK HOST-EXPORT TUCK ( SINGLE SINGLE -- 2ND 1ST 2ND )
+' TUCK-SD HOST-EXPORT TUCK ( SINGLE DOUBLE -- 2ND 1ST 2ND )
+' TUCK-DS HOST-EXPORT TUCK ( DOUBLE SINGLE -- 2ND 1ST 2ND )
+' 2TUCK HOST-EXPORT TUCK ( DOUBLE DOUBLE -- 2ND 1ST 2ND )
+' ROT HOST-EXPORT ROT ( SINGLE SINGLE SINGLE -- 2ND 3RD 1ST )
+' ROT-SSD HOST-EXPORT ROT ( SINGLE SINGLE DOUBLE -- 2ND 3RD 1ST )
+' ROT-SSD HOST-EXPORT ROT ( SINGLE DOUBLE SINGLE -- 2ND 3RD 1ST )
+' ROT-SDD HOST-EXPORT ROT ( SINGLE DOUBLE DOUBLE -- 2ND 3RD 1ST )
+' 2SWAP HOST-EXPORT ROT ( DOUBLE SINGLE SINGLE -- 2ND 3RD 1ST )
+' ROT-DSD HOST-EXPORT ROT ( DOUBLE SINGLE DOUBLE -- 2ND 3RD 1ST )
+' ROT-DSD HOST-EXPORT ROT ( DOUBLE DOUBLE SINGLE -- 2ND 3RD 1ST )
+' 2ROT HOST-EXPORT ROT ( DOUBLE DOUBLE DOUBLE -- 2ND 3RD 1ST )
+' FALSE HOST-EXPORT S>D ( SINGLE -- DOUBLE )
+' S>D HOST-EXPORT S>D ( SIGNED -- SIGNED-DOUBLE )
+' D>S HOST-EXPORT D>S ( DOUBLE -- SINGLE )
+' NOOP HOST-EXPORT SPLIT ( DOUBLE -- SINGLE SINGLE )
+' NOOP HOST-EXPORT MERGE ( SINGLE SINGLE -- DOUBLE )
+' ! HOST-EXPORT ! ( SINGLE ADDRESS -> 1ST -- )
+' 2! HOST-EXPORT ! ( DOUBLE ADDRESS -> 1ST -- )
+' C! HOST-EXPORT ! ( SINGLE CADDRESS -> 1ST -- )
+' @ HOST-EXPORT @ ( ADDRESS -> SINGLE -- 2ND )
+' 2@ HOST-EXPORT @ ( ADDRESS -> DOUBLE -- 2ND )
+' C@ HOST-EXPORT @ ( CADDRESS -> SINGLE -- 2ND )
+' C@EXT HOST-EXPORT @ ( CADDRESS -> SIGNED -- 2ND )
+' C@EXT HOST-EXPORT @ ( CADDRESS -> FLAG -- 2ND )
+' FILL-S HOST-EXPORT FILL ( ADDRESS -> SINGLE UNSIGNED 2ND -- )
+' FILL-D HOST-EXPORT FILL ( ADDRESS -> DOUBLE UNSIGNED 2ND -- )
+' FILL HOST-EXPORT FILL ( CADDRESS -> SINGLE UNSIGNED 2ND -- )
+' ERASE-S HOST-EXPORT ERASE ( ADDRESS -> SINGLE UNSIGNED -- )
+' ERASE-D HOST-EXPORT ERASE ( ADDRESS -> DOUBLE UNSIGNED -- )
+' ERASE-C HOST-EXPORT ERASE ( CADDRESS -> SINGLE UNSIGNED -- )
+' BLANK HOST-EXPORT BLANK ( CADDRESS -> CHARACTER UNSIGNED -- )
+' MOVE-S HOST-EXPORT MOVE ( ADDRESS -> SINGLE ADDRESS -> 2ND UNSIGNED -- )
+' MOVE-D HOST-EXPORT MOVE ( ADDRESS -> DOUBLE ADDRESS -> 2ND UNSIGNED -- )
+' MOVE-C HOST-EXPORT MOVE ( CADDRESS -> SINGLE CADDRESS -> 2ND UNSIGNED -- )
+' SEARCH HOST-EXPORT SEARCH ( CADDRESS -> CHARACTER UNSIGNED 1ST 3RD -- 1ST 3RD FLAG )
+' PAD HOST-EXPORT PAD ( -- CADDRESS -> CHARACTER )
+' + HOST-EXPORT + ( INTEGER INTEGER -- 1ST )
+' + HOST-EXPORT + ( ADDRESS INTEGER -- 1ST )
+' CELLS+ HOST-EXPORT + ( ADDRESS -> SINGLE INTEGER -- 1ST )
+' DCELLS+ HOST-EXPORT + ( ADDRESS -> DOUBLE INTEGER -- 1ST )
+' CHARS+ HOST-EXPORT + ( CADDRESS INTEGER -- 1ST )
+' D+ HOST-EXPORT + ( INTEGER-DOUBLE INTEGER-DOUBLE -- 1ST )
+' UM+ HOST-EXPORT + ( INTEGER-DOUBLE INTEGER -- 1ST )
+' M+ HOST-EXPORT + ( INTEGER-DOUBLE SIGNED -- 1ST )
+' - HOST-EXPORT - ( INTEGER INTEGER -- 1ST )
+' - HOST-EXPORT - ( ADDRESS INTEGER -- 1ST )
+' CELLS- HOST-EXPORT - ( ADDRESS -> SINGLE INTEGER -- 1ST )
+' DCELLS- HOST-EXPORT - ( ADDRESS -> DOUBLE INTEGER -- 1ST )
+' CHARS- HOST-EXPORT - ( CADDRESS INTEGER -- 1ST )
+' D- HOST-EXPORT - ( INTEGER-DOUBLE INTEGER-DOUBLE -- 1ST )
+' UM- HOST-EXPORT - ( INTEGER-DOUBLE INTEGER -- 1ST )
+' M- HOST-EXPORT - ( INTEGER-DOUBLE SIGNED -- 1ST )
+' - HOST-EXPORT - ( ADDRESS 1ST -- SIGNED )
+' -S HOST-EXPORT - ( ADDRESS -> SINGLE 1ST -- SIGNED )
+' -D HOST-EXPORT - ( ADDRESS -> DOUBLE 1ST -- SIGNED )
+' -C HOST-EXPORT - ( CADDRESS 1ST -- SIGNED )
+' 1+ HOST-EXPORT 1+ ( INTEGER -- 1ST )
+' 1+ HOST-EXPORT 1+ ( ADDRESS -- 1ST )
+' CELL+ HOST-EXPORT 1+ ( ADDRESS -> SINGLE -- 1ST )
+' 2CELLS+ HOST-EXPORT 1+ ( ADDRESS -> DOUBLE -- 1ST )
+' CHAR+ HOST-EXPORT 1+ ( CADDRESS -- 1ST )
+' D1+ HOST-EXPORT 1+ ( INTEGER-DOUBLE -- 1ST )
+' 1- HOST-EXPORT 1- ( INTEGER -- 1ST )
+' 1- HOST-EXPORT 1- ( ADDRESS -- 1ST )
+' CELL- HOST-EXPORT 1- ( ADDRESS -> SINGLE -- 1ST )
+' 2CELLS- HOST-EXPORT 1- ( ADDRESS -> DOUBLE -- 1ST )
+' CHAR- HOST-EXPORT 1- ( CADDRESS -- 1ST )
+' D1- HOST-EXPORT 1- ( INTEGER-DOUBLE -- 1ST )
+' +! HOST-EXPORT +! ( INTEGER ADDRESS -> INTEGER -- )
+' D+! HOST-EXPORT +! ( INTEGER-DOUBLE ADDRESS -> INTEGER-DOUBLE -- )
+' UM+! HOST-EXPORT +! ( INTEGER ADDRESS -> INTEGER-DOUBLE -- )
+' M+! HOST-EXPORT +! ( SIGNED ADDRESS -> INTEGER-DOUBLE -- )
+' C+! HOST-EXPORT +! ( INTEGER CADDRESS -> INTEGER -- )
+' +! HOST-EXPORT +! ( INTEGER ADDRESS -> ADDRESS -- )
+' +!-S HOST-EXPORT +! ( INTEGER ADDRESS -> ADDRESS -> SINGLE -- )
+' +!-D HOST-EXPORT +! ( INTEGER ADDRESS -> ADDRESS -> DOUBLE -- )
+' +!-C HOST-EXPORT +! ( INTEGER ADDRESS -> CADDRESS -- )
+' * HOST-EXPORT * ( INTEGER UNSIGNED -- 1ST )
+' * HOST-EXPORT * ( SIGNED SIGNED -- 1ST )
+' TM* HOST-EXPORT * ( INTEGER-DOUBLE UNSIGNED -- 1ST )
+' UM* HOST-EXPORT M* ( UNSIGNED UNSIGNED -- UNSIGNED-DOUBLE )
+' M* HOST-EXPORT M* ( SIGNED SIGNED -- SIGNED-DOUBLE )
+' U/ HOST-EXPORT / ( UNSIGNED UNSIGNED -- 1ST )
+' / HOST-EXPORT / ( SIGNED SIGNED -- 1ST )
+' M/ HOST-EXPORT / ( UNSIGNED-DOUBLE UNSIGNED -- 1ST )
+' UMOD HOST-EXPORT MOD ( UNSIGNED UNSIGNED -- 2ND )
+' MOD HOST-EXPORT MOD ( SIGNED SIGNED -- 2ND )
+' UMMOD HOST-EXPORT MOD ( UNSIGNED-DOUBLE UNSIGNED -- 2ND )
+' U/MOD HOST-EXPORT /MOD ( UNSIGNED UNSIGNED -- 2ND 1ST )
+' /MOD HOST-EXPORT /MOD ( SIGNED SIGNED -- 2ND 1ST )
+' TM/MOD HOST-EXPORT /MOD ( UNSIGNED-DOUBLE UNSIGNED -- 2ND 1ST )
+' U*/ HOST-EXPORT */ ( UNSIGNED UNSIGNED UNSIGNED -- 1ST )
+' */ HOST-EXPORT */ ( SIGNED SIGNED SIGNED -- 1ST )
+' M*/ HOST-EXPORT */ ( UNSIGNED-DOUBLE UNSIGNED UNSIGNED -- 1ST )
+' U*/MOD HOST-EXPORT */MOD ( UNSIGNED UNSIGNED UNSIGNED -- 3RD 1ST )
+' */MOD HOST-EXPORT */MOD ( SIGNED SIGNED SIGNED -- 3RD 1ST )
+' TM*/MOD HOST-EXPORT */MOD ( UNSIGNED-DOUBLE UNSIGNED UNSIGNED -- 3RD 1ST )
+' FM/MOD HOST-EXPORT FM/MOD ( SIGNED-DOUBLE SIGNED -- 2ND SIGNED )
+' SM/REM HOST-EXPORT SM/REM ( SIGNED-DOUBLE SIGNED -- 2ND SIGNED )
+' UM/MOD HOST-EXPORT UM/MOD ( UNSIGNED-DOUBLE UNSIGNED -- 2ND UNSIGNED )
+' 2* HOST-EXPORT 2* ( INTEGER -- 1ST )
+' D2* HOST-EXPORT 2* ( INTEGER-DOUBLE -- 1ST )
+' U2/ HOST-EXPORT 2/ ( UNSIGNED -- 1ST )
+' 2/ HOST-EXPORT 2/ ( SIGNED -- 1ST )
+' DU2/ HOST-EXPORT 2/ ( UNSIGNED-DOUBLE -- 1ST )
+' D2/ HOST-EXPORT 2/ ( SIGNED-DOUBLE -- 1ST )
+' ABS HOST-EXPORT ABS ( SIGNED -- 1ST )
+' DABS HOST-EXPORT ABS ( SIGNED-DOUBLE -- 1ST )
+' NEGATE HOST-EXPORT NEGATE ( INTEGER -- 1ST )
+' DNEGATE HOST-EXPORT NEGATE ( INTEGER-DOUBLE -- 1ST )
+' UMIN HOST-EXPORT MIN ( INTEGER 1ST -- 1ST )
+' MIN HOST-EXPORT MIN ( SIGNED 1ST -- 1ST )
+' UMIN HOST-EXPORT MIN ( ADDRESS 1ST -- 1ST )
+' DUMIN HOST-EXPORT MIN ( INTEGER-DOUBLE 1ST -- 1ST )
+' DMIN HOST-EXPORT MIN ( SIGNED-DOUBLE 1ST -- 1ST )
+' UMAX HOST-EXPORT MAX ( INTEGER 1ST -- 1ST )
+' MAX HOST-EXPORT MAX ( SIGNED 1ST -- 1ST )
+' UMAX HOST-EXPORT MAX ( ADDRESS 1ST -- 1ST )
+' DUMAX HOST-EXPORT MAX ( INTEGER-DOUBLE 1ST -- 1ST )
+' DMAX HOST-EXPORT MAX ( SIGNED-DOUBLE 1ST -- 1ST )
+' U< HOST-EXPORT < ( INTEGER 1ST -- FLAG )
+' < HOST-EXPORT < ( SIGNED 1ST -- FLAG )
+' U< HOST-EXPORT < ( ADDRESS 1ST -- FLAG )
+' DU< HOST-EXPORT < ( INTEGER-DOUBLE 1ST -- FLAG )
+' D< HOST-EXPORT < ( SIGNED-DOUBLE 1ST -- FLAG )
+' U> HOST-EXPORT > ( INTEGER 1ST -- FLAG )
+' > HOST-EXPORT > ( SIGNED 1ST -- FLAG )
+' U> HOST-EXPORT > ( ADDRESS 1ST -- FLAG )
+' DU> HOST-EXPORT > ( INTEGER-DOUBLE 1ST -- FLAG )
+' D> HOST-EXPORT > ( SIGNED-DOUBLE 1ST -- FLAG )
+' = HOST-EXPORT = ( SINGLE 1ST -- FLAG )
+' D= HOST-EXPORT = ( DOUBLE 1ST -- FLAG )
+' <> HOST-EXPORT <> ( SINGLE 1ST -- FLAG )
+' D<> HOST-EXPORT <> ( DOUBLE 1ST -- FLAG )
+' 0< HOST-EXPORT 0< ( SIGNED -- FLAG )
+' D0< HOST-EXPORT 0< ( SIGNED-DOUBLE -- FLAG )
+' 0> HOST-EXPORT 0> ( SIGNED -- FLAG )
+' D0> HOST-EXPORT 0> ( SIGNED-DOUBLE -- FLAG )
+' 0= HOST-EXPORT 0= ( SINGLE -- FLAG )
+' D0= HOST-EXPORT 0= ( DOUBLE -- FLAG )
+' 0<> HOST-EXPORT 0<> ( SINGLE -- FLAG )
+' D0<> HOST-EXPORT 0<> ( DOUBLE -- FLAG )
+' WITHIN HOST-EXPORT WITHIN ( INTEGER 1ST 1ST -- FLAG )
+' WITHIN HOST-EXPORT WITHIN ( ADDRESS 1ST 1ST -- FLAG )
+' AND HOST-EXPORT AND ( SINGLE LOGICAL -- 1ST )
+' OR HOST-EXPORT OR ( SINGLE LOGICAL -- 1ST )
+' XOR HOST-EXPORT XOR ( SINGLE LOGICAL -- 1ST )
+' INVERT HOST-EXPORT INVERT ( LOGICAL -- 1ST )
+' 2* HOST-EXPORT LSHIFT ( LOGICAL -- 1ST )
+' LSHIFT HOST-EXPORT LSHIFT ( LOGICAL UNSIGNED -- 1ST )
+' U2/ HOST-EXPORT RSHIFT ( LOGICAL -- 1ST )
+' RSHIFT HOST-EXPORT RSHIFT ( LOGICAL UNSIGNED -- 1ST )
+' /STRING HOST-EXPORT /STRING ( CADDRESS -> CHARACTER UNSIGNED INTEGER -- 1ST 3RD )
+' 1/STRING HOST-EXPORT /STRING ( CADDRESS -> CHARACTER UNSIGNED -- 1ST 3RD )
+' HERE HOST-EXPORT HERE ( -- ADDRESS )
+' ALIGN HOST-EXPORT ALIGN ( -- )
+' ALIGNED HOST-EXPORT ALIGNED ( ADDRESS -- 1ST )
+' , HOST-EXPORT , ( SINGLE -- )
+' 2, HOST-EXPORT , ( DOUBLE -- )
+' C, HOST-EXPORT C, ( SINGLE -- )
+' ALLOT HOST-EXPORT ALLOT ( INTEGER -- )
+' UNUSED HOST-EXPORT UNUSED ( -- UNSIGNED )
+' DICT-HERE HOST-EXPORT DICT-HERE ( -- ADDRESS )
+' DICT, HOST-EXPORT DICT, ( SINGLE -- )
+' 2DICT, HOST-EXPORT DICT, ( DOUBLE -- )
+' DICT-ALLOT HOST-EXPORT DICT-ALLOT ( INTEGER -- )
+' DICT-ALIGN HOST-EXPORT DICT-ALIGN ( -- )
+' DICT-NAME, HOST-EXPORT DICT-NAME, ( CADDRESS -> CHARACTER UNSIGNED -- )
+' CHARS HOST-EXPORT CHARS ( INTEGER -- 1ST )
+' CELLS HOST-EXPORT CELLS ( INTEGER -- 1ST )
+' KEY HOST-EXPORT KEY ( -- CHARACTER )
+' ACCEPT HOST-EXPORT ACCEPT ( CADDRESS -> CHARACTER INTEGER -- 3RD )
+' EMIT HOST-EXPORT EMIT ( INTEGER -- )
+' TYPE HOST-EXPORT TYPE ( CADDRESS -> CHARACTER UNSIGNED -- )
+' COMPARE HOST-EXPORT COMPARE ( CADDRESS -> CHARACTER UNSIGNED 1ST 3RD -- SIGNED )
+' NOOP HOST-EXPORT NOOP ( -- )
+' TRUE HOST-EXPORT TRUE ( -- FLAG )
+' FALSE HOST-EXPORT FALSE ( -- FLAG )
+' CR HOST-EXPORT CR ( -- )
+' BL HOST-EXPORT BL ( -- CHARACTER )
+' BASE HOST-EXPORT BASE ( -- ADDRESS -> UNSIGNED )
+' >R HOST-EXPORT (>R) ( SINGLE -- )
+' 2>R HOST-EXPORT (>R) ( DOUBLE -- )
+' RDROP HOST-EXPORT (RDROP) ( -- ) IMMEDIATE
+' DRDROP HOST-EXPORT (DRDROP) ( -- ) IMMEDIATE
+' DT-PREFIX HOST-EXPORT DT-PREFIX ( -- DATA-TYPE )
+' DT-INPUT HOST-EXPORT DT-INPUT ( -- DATA-TYPE )
+' DT-OUTPUT HOST-EXPORT DT-OUTPUT ( -- DATA-TYPE )
+' DT-OFFSET HOST-EXPORT DT-OFFSET ( -- DATA-TYPE )
+' DT-AND HOST-EXPORT AND ( DATA-TYPE DATA-TYPE -- 1ST )
+' DT-OR HOST-EXPORT OR ( DATA-TYPE DATA-TYPE -- 1ST )
+' DT-XOR HOST-EXPORT XOR ( DATA-TYPE DATA-TYPE -- 1ST )
+' DT-INVERT HOST-EXPORT INVERT ( DATA-TYPE -- 1ST )
+' DT-ATTRIBUTE? HOST-EXPORT ATTRIBUTE? ( DATA-TYPE DATA-TYPE -- FLAG )
+' DT-NULL? HOST-EXPORT NULL? ( DATA-TYPE -- FLAG )
+' OFFSET HOST-EXPORT OFFSET ( DATA-TYPE -- UNSIGNED )
+' OFFSET+ HOST-EXPORT OFFSET+ ( DATA-TYPE INTEGER -- 1ST )
+' FALSE HOST-EXPORT NEW-TUPLE ( -- TUPLE )
+' T> HOST-EXPORT T> ( TUPLE -> SINGLE -- 1ST 2ND )
+' 2T> HOST-EXPORT T> ( TUPLE -> DOUBLE -- 1ST 2ND )
+' >T HOST-EXPORT >T ( TUPLE -> SINGLE 2ND -- 1ST )
+' 2>T HOST-EXPORT >T ( TUPLE -> DOUBLE 2ND -- 1ST )
+' TDROP HOST-EXPORT DROP ( TUPLE -- )
+' DUP HOST-EXPORT SIZE ( TUPLE -- 1ST UNSIGNED )
+' DTP@ HOST-EXPORT DTP@ ( -- ADDRESS -> DATA-TYPE )
+' DTP! HOST-EXPORT DTP! ( -- )
+' DTP| HOST-EXPORT DTP| ( -- )
+' >DT HOST-EXPORT >DT ( DATA-TYPE -- )
+' DT> HOST-EXPORT DT> ( -- DATA-TYPE FLAG )
+' DT-DEPTH HOST-EXPORT DEPTH ( -- UNSIGNED )
+' PARAM, HOST-EXPORT PARAM, ( STACK-DIAGRAM DATA-TYPE -- 1ST )
+' (PARAM) HOST-EXPORT (PARAM) ( STACK-DIAGRAM DATA-TYPE -- 1ST )
+' -- HOST-EXPORT -- ( STACK-DIAGRAM -- 1ST )
+' DT-> HOST-EXPORT -> ( -- ) IMMEDIATE
+' -> HOST-EXPORT -> ( STACK-DIAGRAM -- 1ST )
+' TH HOST-EXPORT TH ( STACK-DIAGRAM UNSIGNED -- 1ST )
+' ( HOST-EXPORT ( ( -- FLAG STACK-DIAGRAM ) IMMEDIATE
+' STATE! HOST-EXPORT STATE! ( SINGLE -- )
+' <DIAGRAM HOST-EXPORT <DIAGRAM ( FLAG STACK-DIAGRAM -- 2ND )
+' DIAGRAM> HOST-EXPORT DIAGRAM> ( STACK-DIAGRAM -- )
+' ENCLOSE-DIAGRAM HOST-EXPORT ENCLOSE-DIAGRAM ( STACK-DIAGRAM -- 1ST ADDRESS -> DATA-TYPE ADDRESS -> DATA-TYPE )
+' 2CELLS+ HOST-EXPORT PARAMS ( DEFINITION -- ADDRESS -> DATA-TYPE )
+' PARAM@ HOST-EXPORT PARAM@ ( DEFINITION UNSIGNED -- DATA-TYPE )
+' END-DIAGRAM HOST-EXPORT END-DIAGRAM ( STACK-DIAGRAM -- )
+' PARAMS>DT HOST-EXPORT PARAMS>DT ( DEFINITION DATA-TYPE -- )
+' ALL-PARAMS>DT HOST-EXPORT ALL-PARAMS>DT ( DEFINITION UNSIGNED -- 1ST )
+' ) HOST-EXPORT ) ( FLAG STACK-DIAGRAM -- )
+' )COLON HOST-EXPORT ) ( COLON-SYS FLAG STACK-DIAGRAM -- 1ST )
+' FORTH-WID HOST-EXPORT FORTH-WORDLIST ( -- WID )
+' LOCAL-WID HOST-EXPORT LOCAL-WORDLIST ( -- WID )
+' ENVIRONMENT-WID HOST-EXPORT ENVIRONMENT-WORDLIST ( -- WID )
+' GET-CURRENT HOST-EXPORT GET-CURRENT ( -- WID )
+' SET-CURRENT HOST-EXPORT SET-CURRENT ( WID -- )
+' LATEST HOST-EXPORT LATEST ( -- DEFINITION ) VALUE-ATTRIBUTE +ATTRIBUTE
+' LATEST! HOST-EXPORT LATEST! ( -- )
+' NONAME? HOST-EXPORT NONAME? ( DEFINITION -- FLAG )
+' ?NONAME HOST-EXPORT ?NONAME ( DEFINITION -- )
+' NAME HOST-EXPORT NAME ( DEFINITION -- CADDRESS -> CHARACTER UNSIGNED )
+' END-DEF HOST-EXPORT END-DEF ( -- )
+' (CREATE) HOST-EXPORT (CREATE) ( TOKEN -- )
+' (CREATE-NONAME) HOST-EXPORT (CREATE-NONAME) ( TOKEN -- )
+' DICT-CREATE HOST-EXPORT CREATE ( -- )
+' DICT-CODE HOST-EXPORT CODE ( -- )
+' #PARAMS HOST-EXPORT #PARAMS ( DEFINITION -- UNSIGNED )
+' @ HOST-EXPORT >TOKEN ( DEFINITION -- TOKEN )
+' DICT>BODY HOST-EXPORT >BODY ( DEFINITION -- ADDRESS )
+' SEARCH-WID HOST-EXPORT SEARCH ( CADDRESS -> CHARACTER UNSIGNED SINGLE TOKEN WID -- DEFINITION SIGNED )
+' SEARCH-ALL HOST-EXPORT SEARCH-ALL ( CADDRESS -> CHARACTER UNSIGNED SINGLE TOKEN -- DEFINITION SIGNED )
+' ?DATA-TYPE HOST-EXPORT ?DATA-TYPE ( DEFINITION -- DATA-TYPE )
+' DT HOST-EXPORT DT ( -- DATA-TYPE )
+' PARENT HOST-EXPORT PARENT ( DATA-TYPE -- 1ST )
+' ANCESTOR HOST-EXPORT ANCESTOR ( DATA-TYPE -- 1ST )
+' DT-SIZE HOST-EXPORT SIZE ( DATA-TYPE -- UNSIGNED )
+' ?DT-SIZE HOST-EXPORT ?SIZE ( DATA-TYPE -- UNSIGNED )
+' DEPTH-SP HOST-EXPORT DEPTH-SP ( -- UNSIGNED )
+' DTDROP HOST-EXPORT DTDROP ( -- DATA-TYPE )
+' STATE HOST-EXPORT STATE ( -- ADDRESS -> FLAG )
+' [ HOST-EXPORT [ ( -- ) IMMEDIATE
+' ] HOST-EXPORT ] ( -- )
+' CAST HOST-EXPORT CAST ( -- ) IMMEDIATE
+' ?COMPILE HOST-EXPORT ?COMPILE ( -- )
+' ?EXECUTE HOST-EXPORT ?EXECUTE ( -- )
+' TOKEN-FIELD HOST-EXPORT TOKEN-FIELD ( SIGNED DEFINITION SINGLE -- 1ST )
+' ATTRIBUTE-FIELD HOST-EXPORT ATTRIBUTE-FIELD ( SIGNED DEFINITION SINGLE -- 1ST )
+' 2DROP HOST-EXPORT ONLY-NAME ( SIGNED DEFINITION SINGLE -- 1ST )
+' DICT: HOST-EXPORT : ( -- COLON-SYS )
+' DICT:NONAME HOST-EXPORT :NONAME ( -- DEFINITION COLON-SYS )
+' ?PARAMS HOST-EXPORT ?PARAMS ( -- )
+' DICT-EXIT HOST-EXPORT EXIT ( -- ) IMMEDIATE
+' DICT; HOST-EXPORT ; ( COLON-SYS -- ) IMMEDIATE
+' DOES; HOST-EXPORT ; ( DOES-SYS -- ) IMMEDIATE
+:NONAME POSTPONE LITERAL ; HOST-EXPORT LITERAL, ( SINGLE -- )
+:NONAME POSTPONE 2LITERAL ; HOST-EXPORT LITERAL, ( DOUBLE -- )
+' @>DT HOST-EXPORT @>DT ( ADDRESS -> DATA-TYPE -- )
+' <LOCALS HOST-EXPORT <LOCALS ( -- )
+' LOCALS> HOST-EXPORT LOCALS> ( -- )
+' DICT-COMPILE, HOST-EXPORT COMPILE, ( DEFINITION -- )
+' (CAST) HOST-EXPORT (CAST) ( ADDRESS -> DATA-TYPE UNSIGNED FLAG -- )
+' DT>DT HOST-EXPORT DT>DT ( DEFINITION FLAG -- TOKEN )
+' ?CONGRUENT HOST-EXPORT ?CONGRUENT ( DEFINITION ADDRESS -> DATA-TYPE -- )
+' IDENTITY HOST-EXPORT IDENTITY ( SIGNED DEFINITION SINGLE -- 1ST )
+' DEFERRED HOST-EXPORT DEFERRED ( SIGNED DEFINITION SINGLE -- 1ST )
+' MATCH HOST-EXPORT MATCH ( SIGNED DEFINITION SINGLE -- 1ST )
+' ?DT>DT HOST-EXPORT ?DT>DT ( CADDRESS -> CHARACTER UNSIGNED -- TOKEN )
' SINGLE EXPORT-DT SINGLE ( STACK-DIAGRAM -- 1ST )
' INTEGER EXPORT-DT INTEGER ( STACK-DIAGRAM -- 1ST )
' UNSIGNED EXPORT-DT UNSIGNED ( STACK-DIAGRAM -- 1ST )
@@ -1970,195 +1991,195 @@
' DO-SYS EXPORT-DT DO-SYS ( STACK-DIAGRAM -- 1ST )
' CASE-SYS EXPORT-DT CASE-SYS ( STACK-DIAGRAM -- 1ST )
' OF-SYS EXPORT-DT OF-SYS ( STACK-DIAGRAM -- 1ST )
-' #TIB EXPORT #TIB ( -- ADDRESS -> UNSIGNED )
-' TIB EXPORT TIB ( -- CADDRESS -> CHARACTER )
-' SOURCE-ID EXPORT SOURCE-ID ( -- FILE ) VALUE-ATTRIBUTE +ATTRIBUTE
-' >IN EXPORT >IN ( -- ADDRESS -> UNSIGNED )
-' ENCLOSE EXPORT ENCLOSE ( CHARACTER CADDRESS -> 1ST UNSIGNED 4 TH -- 2ND 4 TH 4 TH 4 TH )
-' PARSE EXPORT PARSE ( CHARACTER -- CADDRESS -> CHARACTER UNSIGNED )
-' ENCLOSE-WORD EXPORT ENCLOSE-WORD ( CADDRESS -> CHARACTER UNSIGNED 3RD -- 1ST 3RD 3RD 3RD )
-' PARSE-WORD EXPORT PARSE-WORD ( -- CADDRESS -> CHARACTER UNSIGNED )
-' COMMENT EXPORT \ ( -- )
-' >NUMBER EXPORT >NUMBER ( INTEGER-DOUBLE CADDRESS -> CHARACTER UNSIGNED -- 1ST 2ND 4 TH )
-' >SIGN EXPORT >SIGN ( CHARACTER -- SIGNED )
-' NUMBER EXPORT NUMBER ( CADDRESS -> CHARACTER UNSIGNED -- INTEGER-DOUBLE DATA-TYPE )
-' EXECUTE EXPORT (EXECUTE) ( TOKEN -- )
-' INTERPRET EXPORT INTERPRET ( -- )
-' ?REFILL EXPORT ?REFILL ( -- )
-' STRING-ID EXPORT STRING-ID ( -- FILE )
-' STRONG-INCLUDE-FILE EXPORT INCLUDE ( FILE -- )
-' STRONG-INCLUDED EXPORT INCLUDE ( CADDRESS -> CHARACTER UNSIGNED -- )
-' STRONG-EVALUATE EXPORT EVALUATE ( CADDRESS -> CHARACTER UNSIGNED -- )
-' SEARCH-LOCAL EXPORT SEARCH-LOCAL ( CADDRESS -> CHARACTER UNSIGNED -- ADDRESS -> DATA-TYPE SIGNED )
-' LOCAL, EXPORT LOCAL, ( CADDRESS -> CHARACTER UNSIGNED ADDRESS -> DATA-TYPE -- )
-' [LITERAL] EXPORT [LITERAL] ( -- ) IMMEDIATE
-' FREEZE EXPORT FREEZE ( -- CONTROL-FLOW )
-' THAW EXPORT THAW ( CONTROL-FLOW -- )
-' NESTING EXPORT NESTING ( ADDRESS -> DATA-TYPE INTEGER -- )
-' PARAM@, EXPORT PARAM@, ( DEFINITION STACK-DIAGRAM UNSIGNED 3RD -- 1ST 2ND )
-' +PARAM EXPORT +PARAM ( DEFINITION UNSIGNED -- 1ST 2ND )
-' ENCLOSE-PARAMS EXPORT ENCLOSE-PARAMS ( DEFINITION UNSIGNED -- 1ST 2ND 2ND )
-' ?HAS-INPUT-PARAMS EXPORT ?HAS-INPUT-PARAMS ( DEFINITION -- )
-' ?CHECK-REFERENCES EXPORT ?CHECK-REFERENCES ( DEFINITION UNSIGNED 2ND -- 1ST 2ND 2ND )
-' (DOES) EXPORT (DOES) ( DEFINITION -- )
-' STRONG-DOES> EXPORT DOES> ( COLON-SYS -- DOES-SYS ) IMMEDIATE
-' PROMPT EXPORT PROMPT ( -- )
-' ABORT EXPORT ABORT ( -- )
-' STRONG-QUIT EXPORT QUIT ( -- )
-' BYE EXPORT BYE ( -- )
-' SOURCE-SPEC EXPORT SOURCE-SPEC ( -- ADDRESS -> DOUBLE )
-' FIB EXPORT FIB ( -- CADDRESS -> CHARACTER )
-' #FIB EXPORT #FIB ( -- ADDRESS -> UNSIGNED )
-' STR EXPORT STR ( -- CADDRESS -> CHARACTER )
-' #STR EXPORT #STR ( -- ADDRESS -> UNSIGNED )
-' SOURCE EXPORT SOURCE ( -- CADDRESS -> CHARACTER UNSIGNED )
-' REFILL EXPORT REFILL ( -- FLAG )
-' SPACE EXPORT SPACE ( -- )
-' SPACES EXPORT SPACES ( INTEGER -- )
-' 1ST EXPORT 1ST ( STACK-DIAGRAM -- 1ST )
-' 2ND EXPORT 2ND ( STACK-DIAGRAM -- 1ST )
-' 3RD EXPORT 3RD ( STACK-DIAGRAM -- 1ST )
-' IMMEDIATE EXPORT IMMEDIATE ( -- )
-' HOLD EXPORT HOLD ( CHARACTER -- )
-' <# EXPORT <# ( DOUBLE -- NUMBER-DOUBLE )
-' #> EXPORT #> ( NUMBER-DOUBLE -- CADDRESS -> CHARACTER UNSIGNED )
-' # EXPORT # ( NUMBER-DOUBLE -- 1ST )
-' #S EXPORT #S ( NUMBER-DOUBLE -- 1ST )
-' DU. EXPORT . ( DOUBLE -- )
-' D. EXPORT . ( SIGNED-DOUBLE -- )
-' U. EXPORT . ( SINGLE -- )
-' . EXPORT . ( SIGNED -- )
-' EMIT EXPORT . ( CHARACTER -- )
-' DECIMAL EXPORT DECIMAL ( -- )
-' HEX EXPORT HEX ( -- )
-' DU.R EXPORT .R ( DOUBLE INTEGER -- )
-' D.R EXPORT .R ( SIGNED-DOUBLE INTEGER -- )
-' U.R EXPORT .R ( SINGLE INTEGER -- )
-' .R EXPORT .R ( SIGNED INTEGER -- )
-' +ATTRIBUTE EXPORT +ATTRIBUTE ( LOGICAL -- )
-' IMMEDIATE? EXPORT IMMEDIATE? ( DEFINITION -- FLAG )
-' -TRAILING EXPORT -TRAILING ( CADDRESS -> CHARACTER UNSIGNED -- 1ST 3RD )
-' .DIAGRAM EXPORT .DIAGRAM ( DEFINITION -- )
-' .DEFINITION EXPORT . ( DEFINITION -- )
-' DICT' EXPORT ' ( -- DEFINITION )
-' SEARCH-TOKEN EXPORT SEARCH-TOKEN ( TOKEN -- DEFINITION SIGNED )
-' ?DEFINITION EXPORT ?DEFINITION ( DATA-TYPE -- DEFINITION )
-' .DT EXPORT . ( DATA-TYPE -- )
-' .S EXPORT .S ( -- ) IMMEDIATE
-' NAME>DEFINITION EXPORT NAME>DEFINITION ( CADDRESS -> UNSIGNED -- DEFINITION )
-' PREV EXPORT PREV ( DEFINITION -- 1ST )
-' SLITERAL EXPORT SLITERAL ( CADDRESS -> CHARACTER UNSIGNED -- ) IMMEDIATE
-' " EXPORT " ( -- ) IMMEDIATE
-' STRONG-POSTPONE EXPORT POSTPONE ( -- ) IMMEDIATE
-' (CONSTANT) EXPORT (CONSTANT) ( STACK-DIAGRAM -- 1ST )
-' (VARIABLE) EXPORT (VARIABLE) ( STACK-DIAGRAM -- 1ST )
-' DICT-CONSTANT EXPORT CONSTANT ( SINGLE -- )
-' DICT-VARIABLE EXPORT VARIABLE ( SINGLE -- )
-' DICT-VALUE EXPORT VALUE ( SINGLE -- )
-' DICT-2CONSTANT EXPORT CONSTANT ( DOUBLE -- )
-' DICT-2VARIABLE EXPORT VARIABLE ( DOUBLE -- )
-' DICT-2VALUE EXPORT VALUE ( DOUBLE -- )
-' ?VALUE EXPORT ?VALUE ( CADDRESS -> CHARACTER UNSIGNED -- DEFINITION )
-' STRONG-TO EXPORT TO ( -- ) IMMEDIATE
-' DT+ EXPORT DT+ ( ADDRESS -> DATA-TYPE -- 1ST )
-' CREATE-LOCAL EXPORT CREATE-LOCAL ( CADDRESS -> CHARACTER UNSIGNED -- )
-' FORGET-LOCAL EXPORT FORGET-LOCAL ( -- )
-' (LOCAL) EXPORT (LOCAL) ( CADDRESS -> CHARACTER UNSIGNED -- )
-' STRONG->R EXPORT >R ( -- R-SIZE ) IMMEDIATE
-' STRONG-R> EXPORT R> ( R-SIZE -- ) IMMEDIATE
-' DICT-MARKER EXPORT MARKER ( -- )
-' STRONG-ENVIRONMENT? EXPORT ENVIRONMENT? ( CADDRESS -> CHARACTER UNSIGNED -- ADDRESS FLAG )
-' (ABORT") EXPORT (ABORT") ( SINGLE CADDRESS -> CHARACTER UNSIGNED -- )
-' .ERROR EXPORT .ERROR ( SIGNED -- )
-' DEFER EXPORT DEFER ( -- )
-' IS EXPORT IS ( DEFINITION -- )
-' (CATCH) EXPORT (CATCH) ( TOKEN INTEGER -- SIGNED )
-' STRONG-CATCH EXPORT CATCH ( -- ) IMMEDIATE
-' THROW EXPORT THROW ( SIGNED -- )
-' RECURSE EXPORT RECURSE ( -- ) IMMEDIATE
-' DROP EXPORT (DROP-S) ( SINGLE -- )
-' DROP EXPORT (DROP-S') ( SINGLE 1ST -- 1ST )
-' 2DROP EXPORT (2DROP-S) ( INTEGER 1ST -- )
-' 2DROP EXPORT (2DROP-S) ( ADDRESS 1ST -- )
-' NOOP EXPORT (STEP-S) ( INTEGER -- )
-' NOOP EXPORT (STEP-S) ( ADDRESS -- )
-' 1CELL EXPORT (STEP-S) ( ADDRESS -> SINGLE -- )
-' 2CELLS EXPORT (STEP-S) ( ADDRESS -> DOUBLE -- )
-' 1CHAR EXPORT (STEP-S) ( CADDRESS -- )
-' NOOP EXPORT (+STEP-S) ( INTEGER INTEGER -- )
-' NOOP EXPORT (+STEP-S) ( INTEGER ADDRESS -- )
-' CELLS EXPORT (+STEP-S) ( INTEGER ADDRESS -> SINGLE -- )
-' DCELLS EXPORT (+STEP-S) ( INTEGER ADDRESS -> DOUBLE -- )
-' CHARS EXPORT (+STEP-S) ( INTEGER CADDRESS -- )
-:NONAME POSTPONE AHEAD ; EXPORT (AHEAD) ( -- ORIG )
-:NONAME POSTPONE IF ; EXPORT (IF) ( -- ORIG )
-:NONAME POSTPONE ELSE ; EXPORT (ELSE) ( ORIG -- 1ST )
-:NONAME POSTPONE THEN ; EXPORT (THEN) ( ORIG -- )
-:NONAME POSTPONE BEGIN ; EXPORT (BEGIN) ( -- DEST )
-:NONAME POSTPONE UNTIL ; EXPORT (UNTIL) ( DEST -- )
-:NONAME POSTPONE AGAIN ; EXPORT (AGAIN) ( DEST -- )
-:NONAME POSTPONE WHILE ; EXPORT (WHILE) ( DEST -- ORIG 1ST )
-:NONAME POSTPONE REPEAT ; EXPORT (REPEAT) ( ORIG DEST -- )
-:NONAME POSTPONE CASE ; EXPORT (CASE) ( -- CASE-SYS )
-:NONAME POSTPONE ENDCASE ; EXPORT (ENDCASE) ( CASE-SYS -- )
-:NONAME POSTPONE OF ; EXPORT (OF) ( -- OF-SYS )
-:NONAME POSTPONE ENDOF ; EXPORT (ENDOF) ( CASE-SYS OF-SYS -- 1ST )
-:NONAME POSTPONE DO ; EXPORT (DO) ( -- DO-SYS )
-:NONAME POSTPONE ?DO ; EXPORT (?DO) ( -- DO-SYS )
-:NONAME POSTPONE LOOP ; EXPORT (LOOP) ( DO-SYS -- )
-:NONAME POSTPONE +LOOP ; EXPORT (+LOOP) ( DO-SYS -- )
-:NONAME POSTPONE LEAVE ; EXPORT (LEAVE) ( -- )
-' UNLOOP EXPORT (UNLOOP) ( -- )
-' LOOP, EXPORT LOOP, ( DO-SYS TOKEN -- )
-' +LOOP, EXPORT +LOOP, ( DO-SYS TOKEN -- )
-' ' EXPORT 'HOST ( -- TOKEN )
-' EXPORT EXPORT IMPORT ( TOKEN -- )
-' R/O EXPORT R/O ( -- FAM )
-' W/O EXPORT W/O ( -- FAM )
-' R/W EXPORT R/W ( -- FAM )
-' BIN EXPORT BIN ( FAM -- 1ST )
-' CREATE-FILE EXPORT CREATE ( CADDRESS -> CHARACTER UNSIGNED FAM -- FILE SIGNED )
-' OPEN-FILE EXPORT OPEN ( CADDRESS -> CHARACTER UNSIGNED FAM -- FILE SIGNED )
-' CLOSE-FILE EXPORT CLOSE ( FILE -- SIGNED )
-' DELETE-FILE EXPORT DELETE ( CADDRESS -> CHARACTER UNSIGNED -- SIGNED )
-' READ-FILE EXPORT READ ( CADDRESS -> CHARACTER UNSIGNED FILE -- 3RD SIGNED )
-' WRITE-FILE EXPORT WRITE ( CADDRESS -> CHARACTER UNSIGNED FILE -- SIGNED )
-' FILE-STATUS EXPORT STATUS ( CADDRESS -> CHARACTER UNSIGNED -- LOGICAL SIGNED )
-' FILE-POSITION EXPORT POSITION ( FILE -- UNSIGNED-DOUBLE SIGNED )
-' FILE-SIZE EXPORT SIZE ( FILE -- UNSIGNED-DOUBLE SIGNED )
-' REPOSITION-FILE EXPORT REPOSITION ( UNSIGNED-DOUBLE FILE -- SIGNED )
-' RESIZE-FILE EXPORT RESIZE ( UNSIGNED-DOUBLE FILE -- SIGNED )
-' FLUSH-FILE EXPORT FLUSH ( FILE -- SIGNED )
-' RENAME-FILE EXPORT RENAME ( CADDRESS -> CHARACTER UNSIGNED CADDRESS -> CHARACTER UNSIGNED -- SIGNED )
-' READ-LINE EXPORT READ-LINE ( CADDRESS -> CHARACTER UNSIGNED FILE -- 3RD FLAG SIGNED )
-' WRITE-LINE EXPORT WRITE-LINE ( CADDRESS -> CHARACTER UNSIGNED FILE -- SIGNED )
+' #TIB HOST-EXPORT #TIB ( -- ADDRESS -> UNSIGNED )
+' TIB HOST-EXPORT TIB ( -- CADDRESS -> CHARACTER )
+' SOURCE-ID HOST-EXPORT SOURCE-ID ( -- FILE ) VALUE-ATTRIBUTE +ATTRIBUTE
+' >IN HOST-EXPORT >IN ( -- ADDRESS -> UNSIGNED )
+' ENCLOSE HOST-EXPORT ENCLOSE ( CHARACTER CADDRESS -> 1ST UNSIGNED 4 TH -- 2ND 4 TH 4 TH 4 TH )
+' PARSE HOST-EXPORT PARSE ( CHARACTER -- CADDRESS -> CHARACTER UNSIGNED )
+' ENCLOSE-WORD HOST-EXPORT ENCLOSE-WORD ( CADDRESS -> CHARACTER UNSIGNED 3RD -- 1ST 3RD 3RD 3RD )
+' PARSE-WORD HOST-EXPORT PARSE-WORD ( -- CADDRESS -> CHARACTER UNSIGNED )
+' COMMENT HOST-EXPORT \ ( -- )
+' >NUMBER HOST-EXPORT >NUMBER ( INTEGER-DOUBLE CADDRESS -> CHARACTER UNSIGNED -- 1ST 2ND 4 TH )
+' >SIGN HOST-EXPORT >SIGN ( CHARACTER -- SIGNED )
+' NUMBER HOST-EXPORT NUMBER ( CADDRESS -> CHARACTER UNSIGNED -- INTEGER-DOUBLE DATA-TYPE )
+' EXECUTE HOST-EXPORT (EXECUTE) ( TOKEN -- )
+' INTERPRET HOST-EXPORT INTERPRET ( -- )
+' ?REFILL HOST-EXPORT ?REFILL ( -- )
+' STRING-ID HOST-EXPORT STRING-ID ( -- FILE )
+' STRONG-INCLUDE-FILE HOST-EXPORT INCLUDE ( FILE -- )
+' STRONG-INCLUDED HOST-EXPORT INCLUDE ( CADDRESS -> CHARACTER UNSIGNED -- )
+' STRONG-EVALUATE HOST-EXPORT EVALUATE ( CADDRESS -> CHARACTER UNSIGNED -- )
+' SEARCH-LOCAL HOST-EXPORT SEARCH-LOCAL ( CADDRESS -> CHARACTER UNSIGNED -- ADDRESS -> DATA-TYPE SIGNED )
+' LOCAL, HOST-EXPORT LOCAL, ( CADDRESS -> CHARACTER UNSIGNED ADDRESS -> DATA-TYPE -- )
+' [LITERAL] HOST-EXPORT [LITERAL] ( -- ) IMMEDIATE
+' FREEZE HOST-EXPORT FREEZE ( -- CONTROL-FLOW )
+' THAW HOST-EXPORT THAW ( CONTROL-FLOW -- )
+' NESTING HOST-EXPORT NESTING ( ADDRESS -> DATA-TYPE INTEGER -- )
+' PARAM@, HOST-EXPORT PARAM@, ( DEFINITION STACK-DIAGRAM UNSIGNED 3RD -- 1ST 2ND )
+' +PARAM HOST-EXPORT +PARAM ( DEFINITION UNSIGNED -- 1ST 2ND )
+' ENCLOSE-PARAMS HOST-EXPORT ENCLOSE-PARAMS ( DEFINITION UNSIGNED -- 1ST 2ND 2ND )
+' ?HAS-INPUT-PARAMS HOST-EXPORT ?HAS-INPUT-PARAMS ( DEFINITION -- )
+' ?CHECK-REFERENCES HOST-EXPORT ?CHECK-REFERENCES ( DEFINITION UNSIGNED 2ND -- 1ST 2ND 2ND )
+' (DOES) HOST-EXPORT (DOES) ( DEFINITION -- )
+' STRONG-DOES> HOST-EXPORT DOES> ( COLON-SYS -- DOES-SYS ) IMMEDIATE
+' PROMPT HOST-EXPORT PROMPT ( -- )
+' ABORT HOST-EXPORT ABORT ( -- )
+' STRONG-QUIT HOST-EXPORT QUIT ( -- )
+' BYE HOST-EXPORT BYE ( -- )
+' SOURCE-SPEC HOST-EXPORT SOURCE-SPEC ( -- ADDRESS -> DOUBLE )
+' FIB HOST-EXPORT FIB ( -- CADDRESS -> CHARACTER )
+' #FIB HOST-EXPORT #FIB ( -- ADDRESS -> UNSIGNED )
+' STR HOST-EXPORT STR ( -- CADDRESS -> CHARACTER )
+' #STR HOST-EXPORT #STR ( -- ADDRESS -> UNSIGNED )
+' SOURCE HOST-EXPORT SOURCE ( -- CADDRESS -> CHARACTER UNSIGNED )
+' REFILL HOST-EXPORT REFILL ( -- FLAG )
+' SPACE HOST-EXPORT SPACE ( -- )
+' SPACES HOST-EXPORT SPACES ( INTEGER -- )
+' 1ST HOST-EXPORT 1ST ( STACK-DIAGRAM -- 1ST )
+' 2ND HOST-EXPORT 2ND ( STACK-DIAGRAM -- 1ST )
+' 3RD HOST-EXPORT 3RD ( STACK-DIAGRAM -- 1ST )
+' IMMEDIATE HOST-EXPORT IMMEDIATE ( -- )
+' HOLD HOST-EXPORT HOLD ( CHARACTER -- )
+' <# HOST-EXPORT <# ( DOUBLE -- NUMBER-DOUBLE )
+' #> HOST-EXPORT #> ( NUMBER-DOUBLE -- CADDRESS -> CHARACTER UNSIGNED )
+' # HOST-EXPORT # ( NUMBER-DOUBLE -- 1ST )
+' #S HOST-EXPORT #S ( NUMBER-DOUBLE -- 1ST )
+' DU. HOST-EXPORT . ( DOUBLE -- )
+' D. HOST-EXPORT . ( SIGNED-DOUBLE -- )
+' U. HOST-EXPORT . ( SINGLE -- )
+' . HOST-EXPORT . ( SIGNED -- )
+' EMIT HOST-EXPORT . ( CHARACTER -- )
+' DECIMAL HOST-EXPORT DECIMAL ( -- )
+' HEX HOST-EXPORT HEX ( -- )
+' DU.R HOST-EXPORT .R ( DOUBLE INTEGER -- )
+' D.R HOST-EXPORT .R ( SIGNED-DOUBLE INTEGER -- )
+' U.R HOST-EXPORT .R ( SINGLE INTEGER -- )
+' .R HOST-EXPORT .R ( SIGNED INTEGER -- )
+' +ATTRIBUTE HOST-EXPORT +ATTRIBUTE ( LOGICAL -- )
+' IMMEDIATE? HOST-EXPORT IMMEDIATE? ( DEFINITION -- FLAG )
+' -TRAILING HOST-EXPORT -TRAILING ( CADDRESS -> CHARACTER UNSIGNED -- 1ST 3RD )
+' .DIAGRAM HOST-EXPORT .DIAGRAM ( DEFINITION -- )
+' .DEFINITION HOST-EXPORT . ( DEFINITION -- )
+' DICT' HOST-EXPORT ' ( -- DEFINITION )
+' SEARCH-TOKEN HOST-EXPORT SEARCH-TOKEN ( TOKEN -- DEFINITION SIGNED )
+' ?DEFINITION HOST-EXPORT ?DEFINITION ( DATA-TYPE -- DEFINITION )
+' .DT HOST-EXPORT . ( DATA-TYPE -- )
+' .S HOST-EXPORT .S ( -- ) IMMEDIATE
+' NAME>DEFINITION HOST-EXPORT NAME>DEFINITION ( CADDRESS -> UNSIGNED -- DEFINITION )
+' PREV HOST-EXPORT PREV ( DEFINITION -- 1ST )
+' SLITERAL HOST-EXPORT SLITERAL ( CADDRESS -> CHARACTER UNSIGNED -- ) IMMEDIATE
+' " HOST-EXPORT " ( -- ) IMMEDIATE
+' STRONG-POSTPONE HOST-EXPORT POSTPONE ( -- ) IMMEDIATE
+' (CONSTANT) HOST-EXPORT (CONSTANT) ( STACK-DIAGRAM -- 1ST )
+' (VARIABLE) HOST-EXPORT (VARIABLE) ( STACK-DIAGRAM -- 1ST )
+' DICT-CONSTANT HOST-EXPORT CONSTANT ( SINGLE -- )
+' DICT-VARIABLE HOST-EXPORT VARIABLE ( SINGLE -- )
+' DICT-VALUE HOST-EXPORT VALUE ( SINGLE -- )
+' DICT-2CONSTANT HOST-EXPORT CONSTANT ( DOUBLE -- )
+' DICT-2VARIABLE HOST-EXPORT VARIABLE ( DOUBLE -- )
+' DICT-2VALUE HOST-EXPORT VALUE ( DOUBLE -- )
+' ?VALUE HOST-EXPORT ?VALUE ( CADDRESS -> CHARACTER UNSIGNED -- DEFINITION )
+' STRONG-TO HOST-EXPORT TO ( -- ) IMMEDIATE
+' DT+ HOST-EXPORT DT+ ( ADDRESS -> DATA-TYPE -- 1ST )
+' CREATE-LOCAL HOST-EXPORT CREATE-LOCAL ( CADDRESS -> CHARACTER UNSIGNED -- )
+' FORGET-LOCAL HOST-EXPORT FORGET-LOCAL ( -- )
+' (LOCAL) HOST-EXPORT (LOCAL) ( CADDRESS -> CHARACTER UNSIGNED -- )
+' STRONG->R HOST-EXPORT >R ( -- R-SIZE ) IMMEDIATE
+' STRONG-R> HOST-EXPORT R> ( R-SIZE -- ) IMMEDIATE
+' DICT-MARKER HOST-EXPORT MARKER ( -- )
+' STRONG-ENVIRONMENT? HOST-EXPORT ENVIRONMENT? ( CADDRESS -> CHARACTER UNSIGNED -- ADDRESS FLAG )
+' (ABORT") HOST-EXPORT (ABORT") ( SINGLE CADDRESS -> CHARACTER UNSIGNED -- )
+' .ERROR HOST-EXPORT .ERROR ( SIGNED -- )
+' DEFER HOST-EXPORT DEFER ( -- )
+' IS HOST-EXPORT IS ( DEFINITION -- )
+' (CATCH) HOST-EXPORT (CATCH) ( TOKEN INTEGER -- SIGNED )
+' STRONG-CATCH HOST-EXPORT CATCH ( -- ) IMMEDIATE
+' THROW HOST-EXPORT THROW ( SIGNED -- )
+' RECURSE HOST-EXPORT RECURSE ( -- ) IMMEDIATE
+' DROP HOST-EXPORT (DROP-S) ( SINGLE -- )
+' DROP HOST-EXPORT (DROP-S') ( SINGLE 1ST -- 1ST )
+' 2DROP HOST-EXPORT (2DROP-S) ( INTEGER 1ST -- )
+' 2DROP HOST-EXPORT (2DROP-S) ( ADDRESS 1ST -- )
+' NOOP HOST-EXPORT (STEP-S) ( INTEGER -- )
+' NOOP HOST-EXPORT (STEP-S) ( ADDRESS -- )
+' 1CELL HOST-EXPORT (STEP-S) ( ADDRESS -> SINGLE -- )
+' 2CELLS HOST-EXPORT (STEP-S) ( ADDRESS -> DOUBLE -- )
+' 1CHAR HOST-EXPORT (STEP-S) ( CADDRESS -- )
+' NOOP HOST-EXPORT (+STEP-S) ( INTEGER INTEGER -- )
+' NOOP HOST-EXPORT (+STEP-S) ( INTEGER ADDRESS -- )
+' CELLS HOST-EXPORT (+STEP-S) ( INTEGER ADDRESS -> SINGLE -- )
+' DCELLS HOST-EXPORT (+STEP-S) ( INTEGER ADDRESS -> DOUBLE -- )
+' CHARS HOST-EXPORT (+STEP-S) ( INTEGER CADDRESS -- )
+:NONAME POSTPONE AHEAD ; HOST-EXPORT (AHEAD) ( -- ORIG )
+:NONAME POSTPONE IF ; HOST-EXPORT (IF) ( -- ORIG )
+:NONAME POSTPONE ELSE ; HOST-EXPORT (ELSE) ( ORIG -- 1ST )
+:NONAME POSTPONE THEN ; HOST-EXPORT (THEN) ( ORIG -- )
+:NONAME POSTPONE BEGIN ; HOST-EXPORT (BEGIN) ( -- DEST )
+:NONAME POSTPONE UNTIL ; HOST-EXPORT (UNTIL) ( DEST -- )
+:NONAME POSTPONE AGAIN ; HOST-EXPORT (AGAIN) ( DEST -- )
+:NONAME POSTPONE WHILE ; HOST-EXPORT (WHILE) ( DEST -- ORIG 1ST )
+:NONAME POSTPONE REPEAT ; HOST-EXPORT (REPEAT) ( ORIG DEST -- )
+:NONAME POSTPONE CASE ; HOST-EXPORT (CASE) ( -- CASE-SYS )
+:NONAME POSTPONE ENDCASE ; HOST-EXPORT (ENDCASE) ( CASE-SYS -- )
+:NONAME POSTPONE OF ; HOST-EXPORT (OF) ( -- OF-SYS )
+:NONAME POSTPONE ENDOF ; HOST-EXPORT (ENDOF) ( CASE-SYS OF-SYS -- 1ST )
+:NONAME POSTPONE DO ; HOST-EXPORT (DO) ( -- DO-SYS )
+:NONAME POSTPONE ?DO ; HOST-EXPORT (?DO) ( -- DO-SYS )
+:NONAME POSTPONE LOOP ; HOST-EXPORT (LOOP) ( DO-SYS -- )
+:NONAME POSTPONE +LOOP ; HOST-EXPORT (+LOOP) ( DO-SYS -- )
+:NONAME POSTPONE LEAVE ; HOST-EXPORT (LEAVE) ( -- )
+' UNLOOP HOST-EXPORT (UNLOOP) ( -- )
+' LOOP, HOST-EXPORT LOOP, ( DO-SYS TOKEN -- )
+' +LOOP, HOST-EXPORT +LOOP, ( DO-SYS TOKEN -- )
+' ' HOST-EXPORT 'HOST ( -- TOKEN )
+' EXPORT HOST-EXPORT IMPORT ( TOKEN -- )
+' R/O HOST-EXPORT R/O ( -- FAM )
+' W/O HOST-EXPORT W/O ( -- FAM )
+' R/W HOST-EXPORT R/W ( -- FAM )
+' BIN HOST-EXPORT BIN ( FAM -- 1ST )
+' CREATE-FILE HOST-EXPORT CREATE ( CADDRESS -> CHARACTER UNSIGNED FAM -- FILE SIGNED )
+' OPEN-FILE HOST-EXPORT OPEN ( CADDRESS -> CHARACTER UNSIGNED FAM -- FILE SIGNED )
+' CLOSE-FILE HOST-EXPORT CLOSE ( FILE -- SIGNED )
+' DELETE-FILE HOST-EXPORT DELETE ( CADDRESS -> CHARACTER UNSIGNED -- SIGNED )
+' READ-FILE HOST-EXPORT READ ( CADDRESS -> CHARACTER UNSIGNED FILE -- 3RD SIGNED )
+' WRITE-FILE HOST-EXPORT WRITE ( CADDRESS -> CHARACTER UNSIGNED FILE -- SIGNED )
+' FILE-STATUS HOST-EXPORT STATUS ( CADDRESS -> CHARACTER UNSIGNED -- LOGICAL SIGNED )
+' FILE-POSITION HOST-EXPORT POSITION ( FILE -- UNSIGNED-DOUBLE SIGNED )
+' FILE-SIZE HOST-EXPORT SIZE ( FILE -- UNSIGNED-DOUBLE SIGNED )
+' REPOSITION-FILE HOST-EXPORT REPOSITION ( UNSIGNED-DOUBLE FILE -- SIGNED )
+' RESIZE-FILE HOST-EXPORT RESIZE ( UNSIGNED-DOUBLE FILE -- SIGNED )
+' FLUSH-FILE HOST-EXPORT FLUSH ( FILE -- SIGNED )
+' RENAME-FILE HOST-EXPORT RENAME ( CADDRESS -> CHARACTER UNSIGNED CADDRESS -> CHARACTER UNSIGNED -- SIGNED )
+' READ-LINE HOST-EXPORT READ-LINE ( CADDRESS -> CHARACTER UNSIGNED FILE -- 3RD FLAG SIGNED )
+' WRITE-LINE HOST-EXPORT WRITE-LINE ( CADDRESS -> CHARACTER UNSIGNED FILE -- SIGNED )

ENVIRONMENT-WID SET-CURRENT

-S" /COUNTED-STRING" ENVIRONMENT? [IF] DICT-CREATE /COUNTED-STRING , [THEN]
-S" /HOLD" ENVIRONMENT? [IF] DICT-CREATE /HOLD , [THEN]
-S" /PAD" ENVIRONMENT? [IF] DICT-CREATE /PAD , [THEN]
-S" ADDRESS-UNIT-BITS" ENVIRONMENT? [IF] DICT-CREATE ADDRESS-UNIT-BITS , [THEN]
-S" #LOCALS" ENVIRONMENT? [IF] DICT-CREATE #LOCALS , [THEN]
-S" STACK-CELLS" ENVIRONMENT? [IF] DICT-CREATE STACK-CELLS , [THEN]
-S" RETURN-STACK-CELLS" ENVIRONMENT? [IF] DICT-CREATE RETURN-STACK-CELLS , [THEN]
-S" MAX-CHAR" ENVIRONMENT? [IF] DICT-CREATE MAX-CHAR , [THEN]
-S" MAX-D" ENVIRONMENT? [IF] DICT-CREATE MAX-D 2, [THEN]
-S" MAX-N" ENVIRONMENT? [IF] DICT-CREATE MAX-N , [THEN]
-S" MAX-U" ENVIRONMENT? [IF] DICT-CREATE MAX-U , [THEN]
-S" MAX-UD" ENVIRONMENT? [IF] DICT-CREATE MAX-UD 2, [THEN]
-S" FLOORED" ENVIRONMENT? [IF] DICT-CREATE FLOORED , [THEN]
-
-DICT-CREATE CORE TRUE ,
-DICT-CREATE CORE-EXT TRUE ,
-DICT-CREATE DOUBLE TRUE ,
-DICT-CREATE DOUBLE-EXT TRUE ,
-DICT-CREATE LOCALS TRUE ,
-DICT-CREATE LOCALS-EXT TRUE ,
-DICT-CREATE STRING TRUE ,
-DICT-CREATE STRING-EXT TRUE ,
-DICT-CREATE EXCEPTION TRUE ,
-DICT-CREATE EXCEPTION-EXT TRUE ,
+S" /COUNTED-STRING" ENVIRONMENT? [IF] HOST-DICT-CREATE /COUNTED-STRING , [THEN]
+S" /HOLD" ENVIRONMENT? [IF] HOST-DICT-CREATE /HOLD , [THEN]
+S" /PAD" ENVIRONMENT? [IF] HOST-DICT-CREATE /PAD , [THEN]
+S" ADDRESS-UNIT-BITS" ENVIRONMENT? [IF] HOST-DICT-CREATE ADDRESS-UNIT-BITS , [THEN]
+S" #LOCALS" ENVIRONMENT? [IF] HOST-DICT-CREATE #LOCALS , [THEN]
+S" STACK-CELLS" ENVIRONMENT? [IF] HOST-DICT-CREATE STACK-CELLS , [THEN]
+S" RETURN-STACK-CELLS" ENVIRONMENT? [IF] HOST-DICT-CREATE RETURN-STACK-CELLS , [THEN]
+S" MAX-CHAR" ENVIRONMENT? [IF] HOST-DICT-CREATE MAX-CHAR , [THEN]
+S" MAX-D" ENVIRONMENT? [IF] HOST-DICT-CREATE MAX-D 2, [THEN]
+S" MAX-N" ENVIRONMENT? [IF] HOST-DICT-CREATE MAX-N , [THEN]
+S" MAX-U" ENVIRONMENT? [IF] HOST-DICT-CREATE MAX-U , [THEN]
+S" MAX-UD" ENVIRONMENT? [IF] HOST-DICT-CREATE MAX-UD 2, [THEN]
+S" FLOORED" ENVIRONMENT? [IF] HOST-DICT-CREATE FLOORED , [THEN]
+
+HOST-DICT-CREATE CORE TRUE ,
+HOST-DICT-CREATE CORE-EXT TRUE ,
+HOST-DICT-CREATE DOUBLE TRUE ,
+HOST-DICT-CREATE DOUBLE-EXT TRUE ,
+HOST-DICT-CREATE LOCALS TRUE ,
+HOST-DICT-CREATE LOCALS-EXT TRUE ,
+HOST-DICT-CREATE STRING TRUE ,
+HOST-DICT-CREATE STRING-EXT TRUE ,
+HOST-DICT-CREATE EXCEPTION TRUE ,
+HOST-DICT-CREATE EXCEPTION-EXT TRUE ,

FORTH-WID SET-CURRENT

Anton Ertl

unread,
Oct 1, 2008, 8:37:16 AM10/1/08
to
"Stephan Becher" <stephan.remov...@t-online.de> writes:
>The reason why StrongForth uses its own parsing mechanism is that I found no
>other way to implement EVALUATE and INCLUDE in a portable way.

For implementing EVALUATE you can use EXECUTE-PARSING, which can be
implemented in ANS Forth
<http://www.complang.tuwien.ac.at/forth/compat.zip>.

For implementing INCLUDE, you can use the technique used for
EXECUTE-PARSING (i.e., copy the file, but prepend a word that executes
your interpreter, then INCLUDE the copy); or, if you don't mind that
REFILL, SOURCE-ID, and possibly other words don't work as expected,
have your own loop for reading lines from the file, then EVALUATE each
line using EXECUTE-PARSING.

- anton
--
M. Anton Ertl http://www.complang.tuwien.ac.at/anton/home.html
comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html
New standard: http://www.forth200x.org/forth200x.html
EuroForth 2008: http://www.euroforth.org/ef08.html

Brad Eckert

unread,
Oct 1, 2008, 11:23:50 AM10/1/08
to
On Sep 30, 1:57 pm, Elizabeth D Rather <erat...@forth.com> wrote:
> Most implementations have done this since the dawn of time, but although
> there's common usage for some of the vectors, such vectors have never
> been standardized as to their existence and names.

But some things, like Doug's idea of a hook for unrecognized words,
have a lot of utility without being a burden on vendors. Maybe it's
time to standardize some of these hooks.

If a word is unrecognized, before throwing an error, call something
like UNRECOGNIZED ( c-addr len -- flag ) and then throw the error if
flag<>0. I can think of a few uses for this:

- Specialized numerics like unusual float formats, 0x prefix, etc.
- Data structure or object names like FOO.SIZE, FOO.X, FOO.Y, etc.
- Other kinds of word concatenation like FOO:BAR

-Brad

Bernd Paysan

unread,
Oct 1, 2008, 12:03:52 PM10/1/08
to
Elizabeth D Rather wrote:
> Most implementations have done this since the dawn of time, but although
> there's common usage for some of the vectors, such vectors have never
> been standardized as to their existence and names.

Indeed. And then, there are "common" hooks, i.e. hooks every system has, but
all of them differently. There are even different ways how to create hooks.
I'm compiling a list of those here:

* Defer hooks: This is the typical way to do a hook - use a deferred word
for it. Parameters and name differ between systems.
* Chain hooks: You can add a word into a chain of words, and remove it.
Chains are often used for the cold/bye hooks (e.g. Gforth, VFX). Chain
handling differs between systems.
* OO-like hooks: In Gforth, the input source and the wordlist is an object,
i.e. it contains some data, and a vtable for procedures to be applied to
this data. You can create new classes of input sources and wordlists.
* Table hooks: In Gforth and Bigforth, input and output words (like KEY,
KEY?, EMIT, TYPE) have a jump table to vectorize them. You can switch over
all inputs and outputs to another device type with a single word. Table
hooks are a special case of OO-like hooks (objects without data).
* Module actions: In bigFORTH, there's no cold/bye hook, but a module
system. Each module can define several actions, including initialization
(cold) and termination (bye) hooks. Instead of being chained, modules are a
tree-like structure in bigFORTH. Since you can load and save modules
separately, this is the way to go here.

In general, I think the OO-like hooks is most elegant, at least for features
where you can have several types of the "same thing" and you need to
replace several words at one go (e.g. with IO it doesn't make sense to have
KEY vectored to one type of device, and KEY? to another - they are
associated, and should change together).

One thought Anton and I had on EuroForth was to redefine the outer
interpreter as wordlist stack object (like the search order), which would
when queried first try to find the token in the search order object, then
convert a number, and as last resort report an error message. If you want
to change the interpreter, you just change the "search order" in that
object, and add your new wordlist at the right point (wherever that is -
e.g. a dot parser would come first).

Stephan Becher

unread,
Oct 2, 2008, 9:38:23 AM10/2/08
to
"Josh Grams" <jo...@qualdan.com> schrieb im Newsbeitrag
news:k0KEk.4734$Zf2....@newsfe09.iad...

Indeed. I was wrong. And that's good, because your patch provides a solution
to the parsing problem. I thought that the fact that StrongForth.f has it's
own parsing mechanisms will not allow using the host system's parsing words
at all. But this is not correct, because once StrongForth is running, all of
the host system's parsing words are executed with EVALUATE, and the words
they parse are always included in the evaluation string. The host's parsing
words are never executed in such a way that they need to parse a word from
any other input source.

Based on your patch, I implemented version 1.1 of StrongForth.f, which is
already avaliable on <http://home.vrweb.de/stephan.becher/strongforth.f>. I
defined a terminal input buffer that is independent from the host, and fixed
a couple of other bugs. I could even validate StrongForth.f on CHForth as a
third ANS compatible host system.

Thank you so much for your support.

Regards,
Stephan


Stephan Becher

unread,
Oct 3, 2008, 1:40:53 AM10/3/08
to
"Anton Ertl" <an...@mips.complang.tuwien.ac.at> schrieb im Newsbeitrag
news:2008Oct...@mips.complang.tuwien.ac.at...

> "Stephan Becher" <stephan.remov...@t-online.de> writes:
>>The reason why StrongForth uses its own parsing mechanism is that I found
>>no
>>other way to implement EVALUATE and INCLUDE in a portable way.
>
> For implementing EVALUATE you can use EXECUTE-PARSING, which can be
> implemented in ANS Forth
> <http://www.complang.tuwien.ac.at/forth/compat.zip>.

I wasn't aware that there's an implementation of EXECUTE-PARSING in ANS
Forth. Indeed, with this word being available, EVALUATE can easily be
implemented for a version of StrongForth.f that reuses the host system's
parsing mechanism.

> For implementing INCLUDE, you can use the technique used for
> EXECUTE-PARSING (i.e., copy the file, but prepend a word that executes
> your interpreter, then INCLUDE the copy); or, if you don't mind that
> REFILL, SOURCE-ID, and possibly other words don't work as expected,
> have your own loop for reading lines from the file, then EVALUATE each
> line using EXECUTE-PARSING.
>
> - anton

Yes, that would work as well, although copying the include file looks like a
pretty ugly workaround. Things would become much more natural and easier if
the new standard specified EXECUTE-PARSING and EXECUTE-PARSING-FILE, or
something like FILE-SOURCE and CLOSE-SOURCE as proposed recently. Since
StrongForth.f 1.1 solved the problems with StrongForths's own parsing
mechanism, the pressure to find an alternative solution has been relaxed.
However, the major drawback remains that new parsing words cannot be
directly imported from the host system. Therefore, I will certainly switch
to the preferred solution of reusing the host system's parsing mechanism
once a set of suitable words have been included in the standard.

Regards,
Stephan


Gerry Jackson

unread,
Oct 3, 2008, 2:28:18 AM10/3/08
to

"Stephan Becher" <stephan.remov...@t-online.de> wrote in message
news:gc2isi$c71$01$1...@news.t-online.com...

[...]

> Based on your patch, I implemented version 1.1 of StrongForth.f, which is
> already avaliable on <http://home.vrweb.de/stephan.becher/strongforth.f>.
> I defined a terminal input buffer that is independent from the host, and
> fixed a couple of other bugs. I could even validate StrongForth.f on
> CHForth as a third ANS compatible host system.
>

That has overcome the problem and StrongForth 1.1 now compiles on my system
and basically works. I haven't tried anything significant on it yet.

Gerry


Anton Ertl

unread,
Oct 4, 2008, 12:46:13 PM10/4/08
to
"Stephan Becher" <stephan.remov...@t-online.de> writes:
>StrongForth can now be run as an application on top of every ANS Forth
>system, making strong static type checking and operator overloading
>available on all platforms for which an ANS Forth system exists.

Cool. Thanks.

The first things I attempted (inspired by the introduction) were:

3 4 = 0= . TRUE OK
3 4 = 0 = ? undefined word

It's interesting to think about what 0= should mean in a
statically-typed system. I think your choice is good.

I am annoyed by the case-sensitivity. I especially wonder: Why did
you implemented wordlists and searching from scratch instead of using
the ones present in the host system?

Anton Ertl

unread,
Oct 4, 2008, 12:56:46 PM10/4/08
to
Brad Eckert <nospaa...@tinyboot.com> writes:
>But some things, like Doug's idea of a hook for unrecognized words,
>have a lot of utility without being a burden on vendors. Maybe it's
>time to standardize some of these hooks.
>
>If a word is unrecognized, before throwing an error, call something
>like UNRECOGNIZED ( c-addr len -- flag ) and then throw the error if
>flag<>0. I can think of a few uses for this:
>
>- Specialized numerics like unusual float formats, 0x prefix, etc.
>- Data structure or object names like FOO.SIZE, FOO.X, FOO.Y, etc.
>- Other kinds of word concatenation like FOO:BAR

I think that a extensible hook mechanism (i.e., not just a few
deferred words) would be great, especially for the unrecognized word
part, for the reasons you give, and more.

However, there are also some technical difficulties:

- First, the extensible hook mechanism in general. Different
libraries should be able to hook themselves in without treading on
other libraries uses of these hooks as far as possible. Also, one may
want to specify the order of words hanging on one hook in cases where
there is some treading on each other's feet (e.g., if doubles and
floats hook into the unrecognized words hook, whichever is first will
accept "1.0"). And finally, one may want to remove a hooked word from
the hook.

- Does the "unrecognized word" hook include compilation/execution? If
so, other things that want to do some unusual text-interpretation
things (e.g., the ]] ... [[ syntax for convenient postponing) will not
work with the hooks; moreover, everything that's hanged into the hook
has to do something based on STATE [1]. Alternatively, the hooked words
could provide various data and different xts that would allow more
flexible treatment, but the result would probably be quite complex.

The alternative of hooking two state-dumb words into two hooks does
not seem better to me.

Stephan Becher

unread,
Oct 5, 2008, 4:39:15 AM10/5/08
to
"Anton Ertl" <an...@mips.complang.tuwien.ac.at> schrieb im Newsbeitrag
news:2008Oct...@mips.complang.tuwien.ac.at...
> "Stephan Becher" <stephan.remov...@t-online.de> writes:
>>StrongForth can now be run as an application on top of every ANS Forth
>>system, making strong static type checking and operator overloading
>>available on all platforms for which an ANS Forth system exists.
>
> Cool. Thanks.
>
> The first things I attempted (inspired by the introduction) were:
>
> 3 4 = 0= . TRUE OK
> 3 4 = 0 = ? undefined word
>
> It's interesting to think about what 0= should mean in a
> statically-typed system. I think your choice is good.
>
> I am annoyed by the case-sensitivity. I especially wonder: Why did
> you implemented wordlists and searching from scratch instead of using
> the ones present in the host system?

You can easily switch to case-insensitivity by setting a compile-time flag
according to the instructions at the beginning of strong.f. Maybe I'll make
this the default in the next version, because most people seem to prefer
case insensitivity. I myself prefer case sensitivity, although I definitely
don't like all-caps source code.

StrongForth.f has to implement its own wordlists, because the word lists of
the host system don't provide any information about the stack effect of
words. Searching in StrongForth has to consider the stack effect of words in
order to keep the consistency of the type system and to be able to
distinguish overloaded words. For every word StrongForth takes over from the
host system's dictionary, a stack diagram has to be specified like this:

'HOST DUMP IMPORT DUMP ( ADDRESS UNSIGNED -- )

Regards.
Stephan


Anton Ertl

unread,
Oct 5, 2008, 12:52:39 PM10/5/08
to
"Stephan Becher" <stephan.remov...@t-online.de> writes:
>I myself prefer case sensitivity, although I definitely
>don't like all-caps source code.

Yes, that's the reason why we decided to go with case-insensitivity in
Gforth.

>StrongForth.f has to implement its own wordlists, because the word lists of
>the host system don't provide any information about the stack effect of
>words.

Right, it does not. But that does not mean you have to create your
own wordlists from scratch. You can take the host system's wordlists
just as a lookup mechanism, and define all StrongForth words with,
say, the host's CREATE, and have that host word contain a structure
that contains the stack effect and whatever else you need for a
StrongForth word.

>Searching in StrongForth has to consider the stack effect of words in
>order to keep the consistency of the type system and to be able to
>distinguish overloaded words.

Ok, then the created host word would need to contain the rest for
several StrongForth words (e.g., as a linked list). Ok, this is
getting more complicated than I first thought. I don't think it's as
complicated as doing your own dictionary from scratch, though.

Albert van der Horst

unread,
Oct 5, 2008, 4:58:14 PM10/5/08
to
In article <gbpu0h$eq2$02$1...@news.t-online.com>,

Stephan Becher <stephan.remov...@t-online.de> wrote:
>StrongForth can now be run as an application on top of every ANS Forth
>system, making strong static type checking and operator overloading
>available on all platforms for which an ANS Forth system exists. The
>implementation is called StrongForth.f in order to distinguish it from the
>original DOS based version of StrongForth. It has been successfully
>validated with GForth and SwiftForth. It does not run on Win32Forth, because
>Win32Forth still has a bug in (LOCAL).
>
<SNIP>
I have a general question. I see e.g. a lot about LOCALS in strongforth.
Is that because locals are essential to strongforth?
Or is it that it is reasonably possible to extent strongforth to
other wordsets but not locals? (Maybe because they require lookup,
which interferes with the dictionary?)
Would it be possible to have a strongforth that only implements
the CORE wordset, maybe as an example?

Groetjes Albert

--
--
Albert van der Horst, UTRECHT,THE NETHERLANDS
Economic growth -- like all pyramid schemes -- ultimately falters.
albert@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst

Josh Grams

unread,
Oct 5, 2008, 5:06:52 PM10/5/08
to
Anton Ertl wrote:

> "Stephan Becher" <stephan.remov...@t-online.de> writes:
>
>>StrongForth.f has to implement its own wordlists, because the word
>>lists of the host system don't provide any information about the stack
>>effect of words.
>
> But that does not mean you have to create your own wordlists from
> scratch. You can take the host system's wordlists just as a lookup
> mechanism, and define all StrongForth words with, say, the host's
> CREATE, and have that host word contain a structure that contains the
> stack effect and whatever else you need for a StrongForth word.

But then what do you do about StrongForth :NONAME words?

--Josh

Josh Grams

unread,
Oct 5, 2008, 6:02:55 PM10/5/08
to

Ack! I'm an idiot; of course you can do noname words; you just
can't use the host's xt and >BODY to get the additional info; you have
to define your own structure, xt, and EXECUTE.

--Josh

Stephan Becher

unread,
Oct 6, 2008, 2:23:40 AM10/6/08
to
"Albert van der Horst" <alb...@spenarnc.xs4all.nl> schrieb im Newsbeitrag
news:k8aa9...@spenarnc.xs4all.nl...

> In article <gbpu0h$eq2$02$1...@news.t-online.com>,
> Stephan Becher <stephan.remov...@t-online.de> wrote:
>>StrongForth can now be run as an application on top of every ANS Forth
>>system, making strong static type checking and operator overloading
>>available on all platforms for which an ANS Forth system exists. The
>>implementation is called StrongForth.f in order to distinguish it from the
>>original DOS based version of StrongForth. It has been successfully
>>validated with GForth and SwiftForth. It does not run on Win32Forth,
>>because
>>Win32Forth still has a bug in (LOCAL).
>>
> <SNIP>
> I have a general question. I see e.g. a lot about LOCALS in strongforth.
> Is that because locals are essential to strongforth?
> Or is it that it is reasonably possible to extent strongforth to
> other wordsets but not locals? (Maybe because they require lookup,
> which interferes with the dictionary?)
> Would it be possible to have a strongforth that only implements
> the CORE wordset, maybe as an example?

The original DOS version of StrongForth cannot do without locals, because I,
J and R@ are implemented as locals that are dynamically created and removed.
StrongForth.f, i. e., the version of StrongForth implemented in ANS Forth,
is a little bit different. The host system's word (LOCAL) is not essential.
You can safely remove StrongForth.f's definition of (LOCAL) from strong.f
and the definition of LOCALS| from corelib.sf, and thus obtain a system
without the Locals word set. The Locals word set is not even required in
order to implement additional word sets, although in some cases it might
ease the implementation.

The reason I did not claim full validation on Win32Forth is that my test
suite did not complete because of the bug in (LOCAL). Since I did not want
to spend the effort of making a tailored test suite for a system without the
Locals word set, I don't know whether StrongForth.f without (LOCAL) and
LOCALS| fully runs on Win32Forth. George Hubert claimed that (LOCAL) is
already fixed in Win32Forth CVS, so I'll retry the validation with the next
release of Win32Forth.

It is possible to provide a version of StrongForth with just the Core and
the Double word set. However, several words from other word sets will still
be required. In total, I don't think that much can be saved by stripping the
system of the Exception, File-Access, Locals and String word sets. The
Double word set is essential, because some important double-cell data types
like DATA-TYPE, STACK-DIAGRAM and NUMBER-DOUBLE nedd to be handled.

Regards,
Stephan


Stephan Becher

unread,
Oct 6, 2008, 2:53:41 AM10/6/08
to

"Anton Ertl" <an...@mips.complang.tuwien.ac.at> schrieb im Newsbeitrag
news:2008Oct...@mips.complang.tuwien.ac.at...
> "Stephan Becher" <stephan.remov...@t-online.de> writes:
>>I myself prefer case sensitivity, although I definitely
>>don't like all-caps source code.
>
> Yes, that's the reason why we decided to go with case-insensitivity in
> Gforth.
>
>>StrongForth.f has to implement its own wordlists, because the word lists
>>of
>>the host system don't provide any information about the stack effect of
>>words.
>
> Right, it does not. But that does not mean you have to create your
> own wordlists from scratch. You can take the host system's wordlists
> just as a lookup mechanism, and define all StrongForth words with,
> say, the host's CREATE, and have that host word contain a structure
> that contains the stack effect and whatever else you need for a
> StrongForth word.

For searching the host system's word lists, I'd have to use FIND. But FIND
does not apply the additional matching criteria with respect to the stack
diagrams. Since FIND will always return the first word with the given name,
it has no chance to find the proper version of an overloaded word. One
solution I can think of is to use mangled names like in C++, but these cause
other problems, among which the 31-character restriction for names is just a
minor one. Furthermore, I fear that by always using CREATE for defining new
words, some optimizations of the host system's compiler might get lost.

>>Searching in StrongForth has to consider the stack effect of words in
>>order to keep the consistency of the type system and to be able to
>>distinguish overloaded words.
>
> Ok, then the created host word would need to contain the rest for
> several StrongForth words (e.g., as a linked list). Ok, this is
> getting more complicated than I first thought. I don't think it's as
> complicated as doing your own dictionary from scratch, though.

Yes, a linked list might be a possible solution. But then I'd need a second
level of searching. The result may or may not be less complicated than the
solution that is actually implemented in StrongForth.f. StrongForth.f's
dictionary is just a linked list itself, with each word containg nothing
else but the name, link, xt, attributes and stack diagram. What is
definitely not nice is that each word has to be defined twice, once in the
host's dictionary and once in StrongForth's dictionary.

Regards,
Stephan


0 new messages