CoCoA:Functions

From ApCoCoAWiki

Functions

list the functions of a package

Description

This function returns a list of functions defined in the package

identified by S. (The function <ttref>Packages</ttref> lists the packages currently

loaded into memory.)

Example

  Functions(<quotes>$binrepr</quotes>);
[About(), Man(), Initialize(), PolyBinRepr_xi(P), PolyBinRepr_xii(P),
BinExp(...), EvalBinExp(BE,Up,Down), Aux_BinExp(H,N), Tagged(X,T),
Print_Bin(B), Print_BinExp(BE), Print_BinRepr(BR), PkgName()]
-------------------------------
  L := It;
  Describe L[6];
Define BinExp(...)
  If Shape(ARGV) = [
    INT,
    INT] Then
    Return($binrepr.Aux_BinExp(ARGV[1],ARGV[2]))
  ElsIf Shape(ARGV) = [
    INT,
    INT,
    INT,
    INT] Then
    Return(EvalBinExp($binrepr.Aux_BinExp(ARGV[1],ARGV[2]),ARGV[3],ARGV[4]))
  Else
    Error(ERR.BAD_PARAMS,<quotes>(BinExp arguments must be 2 or 4 INT)</quotes>)
  EndIf;
EndDefine;
-------------------------------

Syntax

Functions(S:STRING):LIST of FUNCTION
   <type>help</type>
   <type>function</type>
   <type>packages</type>