| DEFINE | |
| Syntax | DEFINE name instructionlist |
| Explanation | DEFINE creates a new procedure with the
name of its first input. The second input to DEFINE
determines the definition of the procedure. Any variables for the title line must be in a list that is the first element of the list of instructions, with no dots (:) before their names. If there are no variables, the first element must be the empty list. Each remaining element in the list of instructions is a list that consists of one line of the procedure definition. The list of instructions is written in the same form as the output of TEXT. END must not be included in the
list of instructions, as it is not part of the
definition. |
| Examples | DEFINE "SQUARE [[] [REPEAT 4
[FD 100 RT 90]]] PO SQUARE TO SQUARE REPEAT 4 [FD 40 RT 90] END DEFINE "HEX [[LENGTH] [REPEAT 6 [FD :LENGTH RT 60]]] PO HEX TO HEX :LENGTH REPEAT 6 [FD :LENGTH RT 60] END |