Forth supports two styles of comment; the traditional in-line comment,
(
and its modern cousin, the comment to end of line; \
.
(
( compilation ’ccc<close-paren>’ – ; run-time – ) core,file “paren”
Comment, usually till the next )
: parse and discard all
subsequent characters in the parse area until ")" is
encountered. During interactive input, an end-of-line also acts as
a comment terminator. For file input, it does not; if the
end-of-file is encountered whilst parsing for the ")" delimiter,
Gforth will generate a warning.
\
( compilation ’ccc<newline>’ – ; run-time – ) core-ext,block-ext “backslash”
Comment until the end of line: parse and discard all remaining
characters in the parse area, except while load
ing from a
block: while load
ing from a block, parse and discard all
remaining characters in the 64-byte line.
\G
( compilation ’ccc<newline>’ – ; run-time – ) gforth-0.2 “backslash-gee”
Equivalent to \
. Used right below the start of a
definition to describe the behaviour of a word. In Gforth’s
source code these comments are those that are then inserted in
the documentation.