| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
load.
Ordinarily, the object program generated by the ECL compiler scarcely does
runtime error-checking for runtime efficiency. In addition, Lisp functions in
the same source file are linked together and some system functions are
open-coded in-line. To control runtime error checking, supply appropriate
optimize declarations (see Section 7.1).
The ECL compiler processes the eval-when special form exactly as
specified in [see section Steele:84] (see Section 5.3.3 of [see section Steele:84]).
The ECL compiler is invoked by the functions compile-file,
compile, and disassemble described below. In addition, the
ECL compiler may be invoked directly by the Shell commands ecl.
This command requires the file name of the source file as its
argument. ecl simply adds .lsp to the file name argument to
obtain the full name of the source file.
$ ecl filename |
has the same effect as the compiler invocation (compile-file
filename) from within ECL, and
$ ecl -C filename |
has the same effects as (compile-file filename
:c-file t :h-file t :data-file t).
compile-file compiles the Lisp program stored in the file specified by
pathname, and generates a binary file. If :verbose
message indicating what file is being compiled is printed. If :print
is true, information about top-level forms in the file being compiled is
printed. compile-file generates the following temporary files:
| Temporary File | Contents |
| c-file | C version of the Lisp program |
| h-file | The include file referenced in the c-file |
| data-file | The Lisp data to be used at load time |
If files of these names already exist, the old files will be deleted first.
Usually, these intermediate files are automatically deleted after execution of
compile-file.
The input-file is determined in the usual manner (see Section 2.9), except
that, if the filetype is not specified, then the default filetype .lsp
will be used. The keyword parameter :output-file defines the default
directory and the default name to be applied to the output files (i.e., the
fasl file and the temporary files). :output-file
input-pathname. That is, if :output-file
directory and the name of the input file will be used as the default directory
and the default name for the output files. The file types of the output files
are fixed as follows.
| Output File | Filetype |
| fasl file | .o |
| c-file | .c |
| h-file | .h |
| data-file | .data |
Each output file can be specified by the corresponding keyword parameter.
If the value of the keyword parameter is ()@c, then the output file will be
deleted after execution of compile-file. If the value of the
keyword parameter is T@c, then the output file will be left in the
default directory under the default name. Otherwise, the output file will
be left in the directory under the name specified by the keyword parameter.
The default value of :output-file
of :c-file@c, ::h-file@c, and :data-file
(compile-file 'foo)
FOO.lsp and the fasl file is FOO.o
both in the current directory.
(compile-file 'foo.lish)
FOO.LISH and the fasl file is FOO.o'.
(compile-file "/usr/mas/foo" :output-file "/usr/tai/baa")
foo.lsp in the directory `/usr/mas', and the
fasl file is baa.o in the directory `/usr/tai'.
The ECL compiler is essentially a file compiler, and forms to be
compiled are supposed to be stored in a file. Thus compile actually
creates a source file which contains the form designated by the
arguments. Then compile calls compile-file to get a fasl file,
which is then loaded into ECL. The source file and the fasl file
are given the names `gazonk.lsp' and `gazonk.fasl',
respectively. These files are not deleted automatically after the
execution of compile.
This function does not actually disassemble. It always calls the ECL
compiler and prints the contents of the c-file, i.e., the C-language code,
generated by the ECL compiler. If thing is not supplied, or if it is
()@c, then the previously compiled form by disassemble will be compiled
again. If thing is a symbol other than ()@c, then it must be the name
of a not-yet-compiled function, whose definition is to be compiled. In this
case, it is an error if the name is associated with a special form or a macro.
If thing is a lambda-expression (lambda lambda-list .
body), then disassemble first creates a function definition
(defun gazonk lambda-list . body) and this definition is
compiled. (The function name gazonk has no special meanings. Indeed,
the displayed code is essentially independent of the function name.)
Otherwise, thing itself will be compiled as a top-level form. In any
case, disassemble does not install the compiled function.
disassemble returns no value.
No intermediate h-file is created if the keyword parameter :h-file is
()
is created under the name specified by :h-file@c. Similarly, the
intermediate data-file is specified by the keyword parameter :data-file@c.
| [ << ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |