next up previous contents index
Next: Top-Level Bindings (=) Up: Functions and Constructs Previous: The Apply-to-Each Construct ({})

Defining New Functions (function)

 

Functions can be defined at top-level using the function construct. The syntax is:

tabular4395

A function has one argument, but the argument can be any pattern. The body of a function (the exp at the end) can only refer to variables bound in the pattern, or variables declared at top-level. Any function referred to in the body can only refer to functions previously defined or to the function itself (at present there is no way to define mutually recursive functions). As with all functional languages, defining a function with the same name as a previous function only hides the previous function from future use: all references to a function before the new definition will refer to the original definition.



Jonathan Hardwick
Tue Nov 28 13:57:00 EST 1995