:  ( comp: -- )

published: 28 January 2023 / updated 28 January 2023

Lire cette page en français

 

vocabulary: forth

The word : is the most used creation word in FORTH.

Subsequent execution of NOM performs the execution sequence words compiled in his "colon" definition.

After : NOM, the interpreter enters compile mode. All non-immediate words are compiled in the definition, the numbers are compiled in literal form. Only immediate words or placed in square brackets (words [ and ]) are executed during compilation to help control it.

A "colon" definition remains invalid, ie not inscribed in the current vocabulary, as long as the interpreter did not execute ; (semi-colon).

Example:

: NAME  nomex1 nomex2 ... nomexn ; 
NAME  \ execute NAME