up previous next
Function

return a function
Syntax

Function(S:STRING):FUNCTION
Function(P:STRING, S:STRING):FUNCTION


Description
This function returns the function---user-defined or built in---identified by the string S. In the second form, one first provides the name of the package, then the name of the function. (An alternative is the syntax Function(P.S).

One may use Function to assign a function to a variable which can then be executed via the function Call :

Example
  F := Function("Deg");
  F;
Deg(...)
-------------------------------
  Type(F);
FUNCTION
-------------------------------
  Call(F,x+y^2);
2
-------------------------------
  -- the Call-statement here is equivalent to:
  Deg(x+y^2);
2
-------------------------------
  Function("Insert");
Insert(L, I, O)
-------------------------------
  Function("$list","Insert"); -- or "Function("$list.Insert")"
  Insert(L, I, O)
-------------------------------


See Also