Next: core-ambcond, Previous: The Core Words, Up: The Core Words
-23 THROW
.
EMIT
and non-graphic characters:putc
.
ACCEPT
and EXPECT
:unsigned char
; in the future we might switch to wchar_t
(Comments on that requested).
TABLE
s). The
matching is performed using the C library function strncasecmp
, whose
function is probably influenced by the locale. E.g., the C
locale
does not know about accents and umlauts, so they are matched
case-sensitively in that locale. For portability reasons it is best to
write programs such that they work in the C
locale. Then one can
use libraries written by a Polish programmer (who might use words
containing ISO Latin-2 encoded characters) and by a French programmer
(ISO Latin-1) in the same program (of course, WORDS
will produce
funny results for some of the words (which ones, depends on the font you
are using)). Also, the locale you prefer may not be available in other
operating systems. Hopefully, Unicode will solve these problems one day.
word
is called with the space character as a delimiter, all
white-space characters (as identified by the C macro isspace()
)
are delimiters. Parse
, on the other hand, treats space like other
delimiters. Parse-name
, which is used by the outer
interpreter (aka text interpreter) by default, treats all white-space
characters as delimiters.
cs-item-size
. At the
time of this writing, an item consists of a (pointer to a) locals list
(third), an address in the code (second), and a tag for identifying the
item (TOS). The following tags are used: defstart
,
live-orig
, dead-orig
, dest
, do-dest
,
scopestart
.
[\]^_'
are the digits with the decimal value
36−41. There is no way to input many of the larger digits.
ACCEPT
and EXPECT
:ABORT"
:"error
and a
-2 throw
is performed.
s" /counted-string" environment? drop .
. Currently 255 characters
on all platforms, but this may change.
/line
. Currently 255 characters.
ENVIRONMENT?
, in characters:EMIT
and TYPE
output to the file-id stored in the value
outfile-id
(stdout
by default). Gforth uses unbuffered
output when the user output device is a terminal, otherwise the output
is buffered.
s" address-units-bits" environment? drop .
. 8 in all current
platforms.
MAX-N
,
MAX-U
, MAX-D
and MAX-UD
. The lower bounds for
unsigned (and positive) types is 0. The lower bound for signed types on
two's complement and one's complement machines machines can be computed
by adding 1 to the upper bound.
WORD
:PAD HERE - .
. 104 characters on 32-bit machines. The buffer is
shared with the pictured numeric output string. If overwriting
PAD
is acceptable, it is as large as the remaining dictionary
space, although only as much can be sensibly used as fits in a counted
string.
1 cells .
.
1 chars .
. 1 on all current platforms.
lp@
tib - .
. It is shared with the locals stack and TIBs of files that
include the current file. You can change the amount of space for TIBs
and locals stack at Gforth startup with the command line option
-l
.
PAD HERE - .
. 104 characters on 32-bit machines. The buffer is
shared with WORD
.
PAD
:unused pad here - - .
.
TABLE
s). However, as explained above under character-set
extensions, the matching for non-ASCII characters is determined by the
locale you are using. In the default C
locale all non-ASCII
characters are matched case-sensitively.
ok
in interpret state, compiled
in compile state.
/ mod /mod */ */mod
perform floored
division (with the default installation of Gforth). You can check
this with s" floored" environment? drop .
. If you write
programs that need a specific division rounding, best use
fm/mod
or sm/rem
for portability.
STATE
when true:-55 throw
(Floating-point
unidentified fault) or -10 throw
(divide by zero). Integer
division overflow can result in these throws, or in -11 throw
;
in gforth-fast
division overflow and divide by zero may also
result in returning bogus results without producing an exception.