www.delorie.com/gnu/docs/gforth/gforth_20.html   search  
Buy GNU books!

Gforth Manual

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]


\ That's a comment; it ends at the end of the line
( Another comment; it ends here: )  .s

\ and ( are ordinary Forth words and therefore have to be separated with white space from the following text.

\This gives an "Undefined word" error

The first ) ends a comment started with (, so you cannot nest (-comments; and you cannot comment out text containing a ) with ( ... )(4).

I use \-comments for descriptive text and for commenting out code of one or more line; I use (-comments for describing the stack effect, the stack contents, or for commenting out sub-line pieces of code.

The Emacs mode `gforth.el' (see section 12. Emacs and Gforth) supports these uses by commenting out a region with C-x \, uncommenting a region with C-u C-x \, and filling a \-commented region with M-q.

Reference: 5.3 Comments.

  webmaster     delorie software   privacy  
  Copyright 2003   by The Free Software Foundation     Updated Jun 2003