next up previous
Next: The Code Up: A New Compiler for Previous: Background

Interface

The interface consists of the compile and compile-file functions and several variables.

compile name &optional definition [Function]

The definition is compiled. If name is not nil, then the compiled definition replaces the function definition of name. Definition should be a lambda expression or a function; if it is a function, it must be defined in the top level environment. The default definition is the function definition of name. If name is nil, then the compiled function is returned as the primary value. Otherwise, name is returned.

Two additional values are returned. The second value is true if any errors or warnings were signaled; otherwise it is false. The third value is true if any errors or warnings other than style-warnings were signaled.

compile-file file &key :output-file :load :print [ Function]
             :verbose :temporary-file
             :print-symbol-package

The contents of file is compiled and placed in the file specified by :output-file. The default output file is file with the type replaced by .fsl. If :load is not nil then the compiled file is loaded after compilation. If :print is not nil, then information about the forms being compiled is printed to the standard output. If :verbose is not nil, then a message about the file being compiled and the functions defined and used is printed as a comment to standard output. The temporary file used during compilation defaults to cmptmp.fsl; this can be changed with :temporary-file. Whether symbols are printed fully qualified in the compiler output file is determined by :print-symbol-package.

Three values are returned by compile-file. The primary value is the true name of the output file. The second and third values are as for compile.

*compile-print* [Variable]

The default value of the :print argument to compile-file.

*compile-verbose* [Variable]

The default value of the :verbose argument to compile-file.

*compile-file-pathname* [Variable]

Bound to the path name of the file being compiled by compile-file.

*compile-file-truename* [Variable]

Bound to the true name of the file being compiled by compile-file.

*compile-print-symbol-package* [Variable]

The default value of the :print-symbol-package argument to compile-file.

*inlining-enabled* [Variable]

If this variables is not nil, globally defined functions declared or proclaimed inline and not covered by a notinline declaration are inlined.

*warn-undeclared-globals* [Variable]

If this variable is not nil, then the compiler warns when a global variable is accessed or modified but has not been declared or proclaimed special.

This variable is initially nil. It is useful during development to turn this option on occasionally since it helps to identify errors like incorrectly spelled local variables. But the object system uses globals to represent prototypes, and defproto does not make these variables special. In principle making them special might be a good idea, but it would end up breaking lots of code. (For example, defining a prototype with name x as an experiment would then make x special).

*save-lambda-expressions* [Variable]

If this variable is not nil, then the lambda expression is saved when a function is compiled.



 
next up previous
Next: The Code Up: A New Compiler for Previous: Background
Luke Tierney
1998-10-07