6.1 About the Compiler
compile
, which replaces the interpreted function's definition with the compiled version. A compiled function can call an interpreted function, and vice versa.
> (defun square (x) (* x x)) SQUARE> (compile 'square) SQUARE
compile-file
, which takes a Lisp source file and produces a binary file containing the compiled code. By convention, Lisp source files usually have the extension.lisp
and binary files have the extension.xbin
. Evaluating the expression(compile-file "file.lisp")
produces the filefile.xbin
. To use the compiled functions, you must load the binary file into Lisp by using the functionload
. See Table 2.1 for the appropriate binary file extension for your platform. See Chapter 7, "Additional Extensions to Common Lisp" in The Advanced User's Guide for more information aboutload
.disassemble
prints the assembly code of a compiled function. If the specified function is not compiled,disassemble
first compiles the function and then disassembles the code. You can usedisassemble
to check the efficiency of the Compiler's code or to debug a function. The function uncompile
replaces the compiled version of a function or macro with the original interpreted definition. The function or macro must have been compiled by a call tocompile
. You might useuncompile
when you are debugging a function; some debugging tools, such as the Stepper, provide more complete information for intepreted functions than for compiled functions.
Generated with Harlequin WebMaker