About the input streamnoForth behaves as if input comes from a file.
This means that text between "(" and ")" may contain more than one line:
( this text will be skipped )In noForth "(" is defined as:
: ( [char] ) beyond ; immediateBEYOND scans for a character over multiple lines.
char % beyond this text will be skipped %You saw the words [CHAR] and CHAR in the examples above.
noForth has also CH (a prefix). The rule is very simple:
|Use CH when the character immediately follows, otherwise use CHAR
Forget about [CHAR] but never POSTPONE a prefix ;)
: ( ch ) beyond ; immediate ch % beyond this text will be skipped %To skip text with a ")" in it you could define:
: COMMENT char beyond ; immediate comment * this text will ( also ) be skipped *BL-WORD is a BL WORD that REFILLs when necessary. You could use it to define a simple [IF]-[THEN] (no [ELSE], no nesting):
: [THEN] ; immediate : [IF] ?exit begin bl-word find drop ['] [then] = until ; immediate