| Overview | Module | Function | Class | Tea 3.2.5 Reference Documentation © 2009 PDM&FC |
define varName
define varName value
define functionName formalArgs body
Creates a variable in the current context and initializes it with the given value or a newly created function.
define pi 3.141516
Example of defining a function that calculates and returns the square
value of its argument:
define square ( x ) { * $x $x }
Example of defining a function which accepts a variable number
of arguments:
define lineEcho argList {
foreach arg $argList {
echo $arg
}
}
Defining the same variable more than once in the same context is
legal. Subsequent definitions only change its value, just like if
it was done through the function set!.
| Overview | Module | Function | Class | Tea 3.2.5 Reference Documentation © 2009 PDM&FC |