Implement REQUIRE (Forth 2012)
authorHelmut Eller <eller.helmut@gmail.com>
Wed, 4 Jan 2017 10:11:14 +0000 (11:11 +0100)
committerHelmut Eller <eller.helmut@gmail.com>
Thu, 5 Jan 2017 07:33:54 +0000 (08:33 +0100)
This turned out to be simpler than I had thought, as we can use the
::::<filename> marker to detected already included files.

* fth/require.fth: New file

* fth/loadp4th.fth: Load it. As REQUIRE uses FINDNFA.FROM, the
file filefind.fth is no longer optional.

* fth/system.fth (INCLUDE.MARK.START): Allocate a temporary buffer for
the string.  PAD was problematic because the interpreter versions of
S" and C" also write to PAD, so something like C" foo.fth" $INCLUDE
would created the marker "::::::::".  Despite that, no standard words
should write to PAD.  Of course, neither S" and C" should use PAD.
That's a problem for another day.

* fth/t_file.fth: Restore tests for REQUIRE.
* fth/t_required-helper1.fth, fth/t_required-helper2.fth: Files needed
for tests.


No differences found