====================================================================
A.7.  )compile
====================================================================
 
User Level Required:  compiler
 
Command Syntax: 
 
  -  )compile
  -  )compile fileName
  -  )compile fileName.spad
  -  )compile directory/fileName.spad
  -  )compile fileName )quiet
  -  )compile fileName )noquiet
  -  )compile fileName )break
  -  )compile fileName )nobreak
  -  )compile fileName )library
  -  )compile fileName )nolibrary
  -  )compile fileName )vartrace
  -  )compile fileName )constructor nameOrAbbrev
 
Command Description: 
 
You use this command to invoke the AXIOM library compiler.  This
compiles files with file extension .spad with the AXIOM system
compiler. The command first looks in the standard system directories
for files with extension .spad.
 
Should you not want the )library command automatically invoked, call )compile
with the )nolibrary option. For example,
 
)compile mycode )nolibrary
 
By default, the )library system command exposes all domains and categories it
processes. This means that the AXIOM intepreter will consider those domains
and categories when it is trying to resolve a reference to a function.
Sometimes domains and categories should not be exposed. For example, a domain
may just be used privately by another domain and may not be meant for
top-level use. The )library command should still be used, though, so that the
code will be loaded on demand. In this case, you should use the )nolibrary
option on )compile and the )noexpose option in the )library command. For
example,
 
)compile mycode.spad )nolibrary
)library mycode )noexpose
 
Once you have established your own collection of compiled code, you may find
it handy to use the )dir option on the )library command. This causes )library
to process all compiled code in the specified directory. For example,
 
)library )dir /u/jones/as/quantum
 
You must give an explicit directory after )dir, even if you want all compiled
code in the current working directory processed.
 
)library )dir .
 
You can compile category, domain, and package constructors contained in files
with file extension .spad. You can compile individual constructors or every
constructor in a file.
 
The full filename is remembered between invocations of this command and )edit
commands. The sequence of commands
 
)compile matrix.spad
)edit
)compile
 
will call the compiler, edit, and then call the compiler again on the file
matrix.spad. If you do not specify a directory, the working current directory
(see description of command )cd ) is searched for the file. If the file is
not found, the standard system directories are searched.
 
If you do not give any options, all constructors within a file are compiled.
Each constructor should have an )abbreviation command in the file in which it
is defined. We suggest that you place the )abbreviation commands at the top
of the file in the order in which the constructors are defined. The list of
commands serves as a table of contents for the file.
 
The )library option causes directories containing the compiled code for each
constructor to be created in the working current directory. The name of such
a directory consists of the constructor abbreviation and the .NRLIB file
extension. For example, the directory containing the compiled code for the
MATRIX constructor is called MATRIX.NRLIB. The )nolibrary option says that
such files should not be created. 
 
The )vartrace option causes the compiler to generate extra code for the
constructor to support conditional tracing of variable assignments. (see
description of command )trace ). Without this option, this code is suppressed
and one cannot use the )vars option for the trace command.
 
The )constructor option is used to specify a particular constructor to
compile. All other constructors in the file are ignored. The constructor name
or abbreviation follows )constructor. Thus either
 
)compile matrix.spad )constructor RectangularMatrix
 
or
 
)compile matrix.spad )constructor RMATRIX
 
compiles the RectangularMatrix constructor defined in matrix.spad.
 
The )break and )nobreak options determine what the compiler does
when it encounters an error. )break is the default and it indicates that
processing should stop at the first error. The value of the )set break
variable then controls what happens.
 
Also See: 
o )abbreviation
o )edit
o )library

