Functions can be defined at top-level using the function construct. The syntax is:
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.