up previous next
func

Anonymous function

Syntax
Func ... EndFunc
  returns FUNCTION

Description
This syntatic structure defines a function without giving it a name; anonymous functions can be passed as parameters and assigned to variables. Note that Func...EndFunc can be used inside function definitions.

Example
/**/  square := Func(x) Return x^2; EndFunc;
/**/  square(3);
9

/**/  SortedBy(["zzz", "x", "yy"], Func(x,y) Return len(x)>len(y); EndFunc);
["zzz", "yy", "x"]

See Also