fun fact n .
if n <= 0
then 1
else n * fact (n-1)
end;
fact 5;
that you see in every programming language manual. The code above sets the variable fact to
a representation of the factorial function and then applies it to the value 5 to give 120.
Note, you can't do
fact := lambda n .
if n <= 0
then 1
else n * fact (n-1)
end;
because ccli will complain that fact is an unbound variable (which it is in
this case: the right hand side of an assignment is always evaluated before the left hand side unless
you use the fun keyword).