| |||||||||||||
KASH3 Reference Manual | |||||||||||||
| |||||||||||||
Statementfunction
Syntaxfunction ( [ <arg-ident> {, <arg-ident>} ] ) [ local <loc-ident> {, <loc-ident>} ; ] <statements> end;DescriptionBecause for each of the formal arguments <arg-ident> and for each of the formal locals <loc-ident> a new variable is allocated when the function is called, it is possible that a function calls itself. This is usually called recursion. When a function <fun1> definition is evaluated inside another function <fun2>, KASH binds all the identifiers inside the function <fun1> that are identifiers of an argument or a local of <fun2> to the corresponding variable. This set of bindings is called the environment of the function <fun1>. When <fun1> is called, its body is executed in this environment. In KASH (by convention) the names of function which return nothing and act destructively on the input end in '_'. See also | |||||||||||||
Built:
Mon Nov 14 21:12:39 UTC 2005 on mackThe KANT Group |