let([X=1 Y=2] writeln(X+Y))
Prolog variable assignment is used. assignments are local to the whole enclosing function call or function definition, not just the let function (this behavior may change)
Func can be the name of a 1-argument function
map(writeln [a b c d])
\endP\{verbatim}
Or a lambda function (see below)
\begin{verbatim}
map(lambda([X] X+1) [1 2 3 4]) => [2 3 4 5]
\endP\{verbatim}
\func{lambda(Args Body)} lambda function. evaluates to itself. See example above
Syntactic sugar: for a single argument function, you can also say
\func{\\Arg -> Body}
\begin{verbatim}
map(\X->X+1 [1 2 3]) => [2 3 4]
foo(X Y) := (X*Y)/2 apply(foo [4 3]) => 6
Functions can be curried:
foo(X Y) := (X*Y)/2 apply(foo [4]) => lambda([Y] (4*Y)/2) apply(apply(foo [4]) [3]) => 6
#foo(1+2) => foo(1+2)
eval('1+2') => 3