:


Next: ; Up: COD Command Summary Previous: 2

:

Begin a new colon definition. In COD, colon definitions define new dictionary words (i.e., new functions). The token following the : is taken to be the name of the function. All words typed after the : are compiled (stored) into memory. A semicolon ; terminates the colon definition and returns the state from compile to execute mode. The name of the function must not match any existing COD keyword. The interactive COD program does not print the stack when the internal state is compiling (i.e., during a colon definition).

Example:

 0.0
COD> : X2 DUP * ;
 0.0
COD> 5
 0.0 5.0
COD> X2
 0.0 25.0



Web Page Maintained by: Dr. Lawrence E. Brown elwin@redshift.gsfc.nasa.gov