COMPILE-FILE
COMPILE-FILE
compiles a file to a platform-independent
bytecode:
(COMPILE-FILE
filename
&KEY
:OUTPUT-FILE
:LISTING:EXTERNAL-FORMAT
((:WARNINGS
CUSTOM:*COMPILE-WARNINGS*
)CUSTOM:*COMPILE-WARNINGS*
) ((:VERBOSE
*COMPILE-VERBOSE*
)*COMPILE-VERBOSE*
) ((*COMPILE-PRINT*
)*COMPILE-PRINT*
))
Options for COMPILE-FILE
filename
:OUTPUT-FILE
NIL
or T
or a pathname designator or an
output STREAM
. The default is T
.:LISTING
NIL
or T
or a pathname designator or an
output STREAM
. The default is NIL
.:EXTERNAL-FORMAT
EXT:ENCODING
of the filename
.
:WARNINGS
:VERBOSE
:PRINT
The variables CUSTOM:*COMPILE-WARNINGS*
(initially set to T
), *COMPILE-VERBOSE*
(initially set to T
,
affected by -v
) *COMPILE-PRINT*
(initially set to NIL
,
affected by -v
) provide defaults for the :WARNINGS
, :VERBOSE
,
:PRINT
keyword arguments, respectively, and are bound by COMPILE-FILE
to the values of the arguments, i.e., these arguments are recursive.
For each input file (default file type: #P".lisp"
)
the following files are generated:
File | When | Default file type | Contents |
---|---|---|---|
output file | only if :OUTPUT-FILE is not NIL | #P".fas" | can be loaded using the LOAD function |
auxiliary output file | only if :OUTPUT-FILE is not NIL | #P".lib" | used by COMPILE-FILE when compiling a REQUIRE form referring
to the input file |
listing file | only if :LISTING is not NIL | #P".lis" | disassembly of the output file |
C output file | only if :OUTPUT-FILE is not NIL | #P".c" | “FFI”; this file is created only if the source contains “FFI” forms |
As per [ANSI CL standard], COMPILE-FILE
returns 3 values:
#P".fas"
, or NIL
if the file could not be created, in which case the compilation is
considered to have failedNIL
if no conditions of type ERROR
or WARNING
were detected during compilation, and the number of such conditions otherwise
NIL
if no conditions of type ERROR
or WARNING
(other than STYLE-WARNING
) were detected during compilation,
and the number of such conditions otherwise
Since CLISP tends to be relatively garrulous with warnings
(see, e.g., Section 12.2.4.1, “Rule of Float Precision Contagion sec_12-1-4-4”), the non-NIL
tertiary return value
(called failure-p
by the [ANSI CL standard])
does not indicate a failure of compilation.
The correct way to check whether COMPILE-FILE
has failed is the
primary return value.
These notes document CLISP version 2.49.93+ | Last modified: 2018-02-19 |