up previous next
package    --    keyword marking content of a CoCoA package


Syntax
package PkgName: STRING);

Description
This is for more advanced use of CoCoA-5, when you have several functions for closely related operations which you wish to store together in a file.

We recommend putting all functions belonging together in a package into a single file (whose name should indicate the purpose of the package). Inside the file, at the start write package followed by the package name (usu. the same as as the file name, but with a dollar-sign prepended); at the end of the file put EndPackage;.

Use the export command to indicate which functions are intended for public use (rather than being auxiliary functions).

See also the entry First Example of a Package .

Example
/**/ package $demo;
/**/   export MyFunc;
/**/   define MyFunc(N) return N+1; enddefine;
/**/ EndPackage;

See Also