up previous next
5.3.1 User Initialization
At the beginning of a CoCoA session, CoCoA reads in a file called init.coc. This file performs certain initialization routines, reads in standard packages, and sets up global aliases for the packages. It also reads in a file called userinit.coc. It is in this latter file that users should put their own commands to be run when CoCoA starts.

For example, suppose a user wants a file called MyFile.coc--- containing function definitions, variable assignments, etc.---to automatically be read into the CoCoA system on start-up. It suffices to add the following line to userinit.coc:
  Source "MyFile.coc";
To load the package with identifier $contrib/mypackage, contained in a file MyPackage.cpkg and use MP as an alias, it suffices to add the following lines to userinit.coc (you may want to look at the section of the manual entitled Package Sourcing and Autoloading for more details):
  Source "MyPackage.cpkg";
  Alias MP := $contrib/mypackage;