ALLOCATE
and RESIZE
.
These words now pass the tests in Gerry Jackson's anstests
file, memorytest.4th.ACCEPT
to conform to ANS
Forth. Previously ACCEPT
returned when the maximum
number of characters was input, instead of waiting for the end
of line character. This problem was reported by Zbigniew Baniewski.
CONSTANT
so that it may be
used to define address constants as well as ordinary integer
constants. Due to address type checking in kForth, it had been
necessary previously to define a word, PTR
, in source,
to provide address constants. However, since the data type of the
item residing on the stack may be determined at compile time by
CONSTANT
it is possible to assign the appropriate type
of fetch for the defined word.PRECISION
,
SET-PRECISION
, and FS.
. The startup precision
is set to 15. The floating point output word, F.
, ignores
the precision setting and provides an automatic output format for general
purpose use. The word FS.
outputs a floating point number
to the number of significant digits specified by PRECISION
using scientific notation, per DPANS94.[DEFINED]
and
[UNDEFINED]
, which were previously defined in source
in ans-words.4th.[ELSE]
in
ans-words.4th to ignore case of conditional compilation
words. A problem still exists if [THEN]
is preceeded
by a tab or other white space character which is not a blank space.Public:
, Private:
code hiding facility in the Forth Scientific Library code (see
the examples/fsl/ subdirectory). Prior to version 1.5.1,
kForth did not support wordlists and the code hiding facility in
the FSL was disabled.
New Forth source files included in version 1.5.2 are:
examples/:
client.4th
server.4th
socket.4th
fsm2.4th
chr_tbl.4th
ftran202.4th
ftran-test.4th
lyx-included.4th
examples/system-test/
fpio-test.4th
memorytest.4th
examples/lyx/:
lpforth.lyx
sl.lyx
examples/fsl/:
aitken.4th
dfourier.4th
elip12.4th
erf.4th (moved from fsl/extras/)
hermite.4th
lagroots.4th
polrat.4th
quadratic.4th (moved from fsl/extras/)
ran4.4th
examples/fsl/extras/
array-utils0.4th
array-utils1.4th
gamma-aph.4th
numerov.4th
qsort.4th
zerf.4th
The new file, examples/lyx-included.4th, supports literate programming
in Forth, using the LyX editor and the
noweb tool for extracting source
code from a literate program. Instructions for configuring LyX for literate
programming are given in lyx-included.4th, and sample literate Forth programs
are provided in the folder, examples/lyx/ .
Updated Forth source files in version 1.5.2 are:
examples/:
ans-words.4th
gpib.4th
histogram.4th
lists.4th
lists-test.4th
mini-oof.4th
mini-oof-demo.4th
notes.4th
struct-ext.4th
tpf.4th
ttester.4th
utils.4th
examples/system-test/:
paranoia.4th
regress.4th
examples/games/:
strek.4th
examples/fsl/:
backsub.4th
complex.4th
complex-test.4th
dets.4th
fsl-tester.4th
fsl-util.4th
gaussj.4th
lufact.4th
pcylfun.4th
regfalsi.4th
examples/fsl/extras/:
noise.4th
stats.4th
zwofz.4th
2CONSTANT 2VARIABLE INCLUDED
>NUMBER >FLOAT
2LITERAL SLITERAL FLITERAL
FLOATS FLOAT+ FALOG
BLANK /STRING -TRAILING PARSE
WITHIN RESIZE D2* D2/
DEFINITIONS WORDLIST GET-CURRENT
SET-CURRENT GET-ORDER SEARCH-WORDLIST
ALSO ONLY PREVIOUS
FORTH-WORDLIST FORTH ASSEMBLER
ASSEMBLER
places the
intrinsic assembler wordlist at the top of the search order,
although the actual assembler words must be loaded from
the Forth source, asm-x86.4th.DLOPEN DLERROR DLSYM DLCLOSE
ALIAS F2DROP
VOCABULARY
DLxxx
words allow access to external
C and Fortran shared object libraries.ALIAS
allows an existing word to be
referenced by another name.VOCABULARY
is used to create a
named wordlist.BASE
.POSTPONE WORD
POSTPONE
did not work correctly with some
intrinsic words depending on their location within the
dictionary. This has been fixed.WORD
did not behave correctly in parsing
the space character when the delimiter character was not
a space. This problem has been fixed.+LOOP COMPARE SEARCH
+LOOP
, in previous versions, conformed to
the behavior described in Brodie's, Starting Forth
(Forth-83). The revised version passes all tests in the
system test file, coreplus.4th.COMPARE
and SEARCH
,
previously did not have standard behavior when comparing
or searching for empty strings. Both words now pass the
tests in the system test file, stringtest.4th.WRITE-FILE WRITE-LINE REPOSITION-FILE
READ-LINE
in
files.4th has been changed to fix a bug: READ-LINE
did not return the correct values if the last line in the
file was not terminated by an EOL character. This
has been fixed.WRITE-FILE
WRITE-LINE
READ-LINE
REPOSITION-FILE
'
, "tick",
to report an error when the ticked word is not found in
the search order. In previous versions, "tick" simply
returned an invalid address.F/
to not check for and
handle divide by zero, since the output of the floating
point unit may be "+/-inf" or "nan"
which may be considered to be valid results.SYSCALL
to make it more
useful for implementing Forth words to perform system
calls: a) changed the order of usage of arguments so
that a Forth word can accept arguments in the same order
as the corresponding C function for a syscall,
b) allow up to 6 arguments to SYSCALL
which
permits the implementation of all known syscalls.F**
for higher accuracy,
to address a problem reported by paranoia.4th.NUMBER?
to work with
full range of signed double length numbers.fsl/ | Forth Scientific Library modules |
games/ | Forth console games |
libs/ | Interfaces to C and Fortran shared object libraries | >
benchmarks/ | Benchmark programs for execution speed | >
system-test/ | Forth system test code |
SYSCALL
,
the Forth source file, syscalls386.4th has been
renamed to syscalls.4th and numerous Forth words have
been defined to provide system calls. Please see the
WARNING notice about use of the system call words in
the comments for this file.
SYSCALL
is currently not functional
under Cygwin. It is only a stub for possible future implementation.
MOVE
in the x86-linux version
was noticed during the port. The problem has been fixed in
this x86-cygwin release, and we expect to release a patch for
the 1.4.1 x86-linux distribution. For additional information,
please refer to the
README.SNAP file in the
1.4.x development directory.
#!
(synonymous with \
)
to allow Forth source (.4th) files to be run as executable scripts.
M*/
in
the x86 version.
#!
(synonymous with \
)
to allow Forth source (.4th) files to be run as executable scripts.
MOD
and /MOD
from v 1.3.2 have been incorporated
into v 1.4.1. Added checks for division by zero and
division overflow errors in UM/MOD
and
UTM/
. Also added checks for division by zero
for FM/MOD
and SM/REM
.
These changes provide consistent behavior with the
ppc-osx version.
STS/REM
fail at present on
the x86-linux version. Also, tests with a negative divisor for
M*/
, an ambiguous condition, give different results
than the ppc-osx version.DU<
,
DMAX
, DMIN
, DS*
,
UTM/
, UTS/MOD
,
STS/REM
, UDM*
, MOVE
,
F0>
, and SYSCALL
MOVE
,
DMAX
, and DMIN
in ans-words.4th,
since these words are now intrinsic.
>NUMBER
in
ans-words.4th to use UDM*
instead of
M*/
.
M*/
fails in some test cases in the x86 versions of kForth.
D<>
,
D>
, D>=
, D<=
,
D0<
), and to add tests to catch certain errors
in the implementation of D<
. The modified file
remains ANS Forth compatible.
SOURCE
in core.4th,
since kForth implementation of SOURCE
does not conform
to ANS.
FORTH-SIGNAL ( xt n -- xtold | install word as handler for signal n ) RAISE ( n -- ior | assert signal n ) SET-ITIMER ( type aval aoldval -- error | set up timer signals ) GET-ITIMER ( type aval -- error | get timer countdown count )The file signal.4th defines the various signals, and the file signals-ex.4th provides examples of how to install and use a signal handler from Forth. The current implementation allows periodic tasks to be accomplished in the background through the timer signals, but, as yet, there is no way to handle exceptions like SIGFPE and SIGSEGV due to the absence of a longjmp in the handler.
FTRUNC>S
.EVALUATE
which were causing problems with
defining macros using S" ..." EVALUATE
.
WORD
: two subsequent
calls to WORD
, such as
"BL WORD BL WORD
",
would drop the first character of the second word.
F>S
to FROUND>S
.
The word F>S
has been implemented inconsistently
in different Forth systems in the past. In some systems
F>S
represented truncation to an integer
while in others it rounded to an integer. It has been
decided to implement explicit words for these two distinct
operations and to remove F>S
to avoid
ambiguity. In addition to FROUND>S
, the
complementary word FTRUNC>S
provides
truncation to a single length integer. For consistency,
the word FTRUNC
has also been added. It complements
the existing word FROUND
. The
Portable Forth
Environment (PFE) also provides these new words, as of version
0.32.94, but PFE also retains F>S
with
the meaning of truncation to integer.
SOURCE
and REFILL
.
WORD
. For a
non-blank delimiter, WORD
was not removing the
delimiting character from the input stream. WORD
now consumes the delimiting character.
.S
. Also,
a check for stack underflow is performed upon return from the
virtual machine, whether or not a VM error has occured.
IMMEDIATE
has been fixed.
EVALUATE
;
however, users should consider this release to be unstable due to
insufficient testing or burn-in with real use. For Linux, a new source
package is provided. For Windows, a new executable is provided.
POSTPONE
which would not work
for non-immediate words in previous versions.
EVALUATE
which could not be used to
define inline words, due to reentrancy problems in previous versions.
FM/MOD
which did not handle negative divisor properly in previous versions.
CMOVE>
which did not work for zero count.
ABORT"
which printed garbage prior to message.
VARIABLE,
CONSTANT, FVARIABLE, FCONSTANT
. Such words could
previously not be ticked.
include
file, rather than the cumulative
line number. Also, previously, multiline comments or
.(
output would not increment the line
counter. This problem has been fixed. Error reporting has been
improved considerably.
SEARCH
,
COMPARE
, and STATE
.
MS@
which returns the number of
milliseconds elapsed since starting up the kForth environment.
EVALUATE
and
[
and ]
.
.(
-- this word
now behaves properly.
IMMEDIATE
and NONDEFERRED
. More
information about precedence in kForth will be
given in the Technical Information section of the User's Guide.
>BODY, POSTPONE, IMMEDIATE, NONDEFERRED,
<#, #, #S, SIGN, HOLD, #>
.
FIND
to return code pointer
(execution token) instead of parameter field address (data field).
The two fields are the same for words not created with
defining words.
.R
and U.R
to not
print a space following the output field.
WORD
to not include space immediately
following WORD
when delimiter is not a space.
ACCEPT
to allow backspace editing of input line.
?DO
.
2>R, 2R>, 2R@, D+, D-, D<, D=, D0=, D., .(
.
DNEGATE
bug for double-length zero.
F0<
, KEY
, and
KEY?
.
DABS
and DNEGATE
.
F0<
was resolved to allow proper build under as 2.10.90.
USLEEP
is implemented
differently to provide more accurate time
delays for short intervals. USLEEP
no
longer makes use of the system usleep function.
DABS
and DNEGATE
are implemented.
CASE...OF...ENDOF...ENDCASE
control
structure has been added.
CASE...OF...ENDOF...ENDCASE
control
structure has been added.
INCLUDE
. This
is done through the environment variable KFORTH_DIR.
+LOOP
bug for negative increment.
ROLL
.
LITERAL, M*, UM*, S",
C", FM/MOD, SM/REM
.
CHAR
behavior to conform to ANS standard,
and added [CHAR]
. Removed the word ASCII
from the dictionary.
0<>, .R, U.R, ?ALLOT
.
?ALLOT
is a non-standard word.
F0=
to handle negative zero value.
CELLS, CELL+, DFLOATS, DFLOAT+,
SFLOATS, SFLOAT+, CHAR+, S>D, F>D, D>F, F0=, F0<, U>
.
>FILE, CONSOLE, RECURSE
.
WORD
and '
(tick).
NUMBER?
to give same results as PFE and UR/FORTH.