Defining Functions

Special cases: a procedure is a function with no
mathematically sound result, it returns ().
For instance, assignment functions return ().

Calling Functions

Using parens: f (x)Using a space: f xMore than one arguments: f (x) (y) or f x yWarning: if an argument is complex you must
enclose it between parens.
For instance f (x + 1)
(and not f x + 1, which means f (x) + 1,
that is 1 + f (x)).

Special cases: functions with no argument
get () as argument.
For instance print_newline is called with
print_newline ().

Matching

A pattern matching appears after the keywords function, or
with
(in functionmatching,
try ... withmatching, or
match ... withmatching).
Warning: a pattern matching which is nested inside
another one must be enclosed by begin end keywords.

A pattern matching is a list of clauses pattern ->
expression: each clause is tried in the order of presentation;
the first clause for which the pattern corresponds to
(is more general than) the value is selected; the corresponding
expression is then returned.