
fun - returns pure functions

Calling sequence:
fun(expr)

Parameter:

expr   --  expression

Summary:

fun(expr) re-constructs the expression expr as a function with the variables
args(1) ... args(args(0)) and returns this as a pure function. The expression
expr is not evaluated.

A pure function is executed in a similar manner to a procedure. However, it
has no formal parameters or local variables.  (This means that it also does
not have any local environment-variables.) The current parameters can only
be accessed by using args.

If a pure function is called with too few current parameters then an error is
returned. Any extra parameters are ignored.

Compared to the usual functions, pure functions are much faster.

>>  f:= fun(sin(args(1)^2 + args(2)^2)): f(x,y);

      sin(x^2 + y^2)

See also:  args, func

