Next: , Up: Compiled Lisp   [Contents][Index]

5.17.1 Compilation Functions

These functions are defined in rep.vm.compiler.

Function: compile-form form

This function compiles the Lisp form form into a byte-code form which is returned.

(compile-form '(setq foo bar))
    ⇒ (run-byte-code "\030F!v" [bar foo] 2)
Command: compile-function function

This function replaces the uncompiled body of the function function (a symbol) with a compiled version, then returns function.

Command: compile-file file-name

This function compiles the file called file-name into a file of compiled Lisp forms whose name is file-name with ‘c’ appended to it (i.e. if file-name is foo.jl it will be compiled to

If an error occurs while the file is being compiled any semi-written file will be deleted.

When called interactively this function will ask for the value of file-name.

Command: compile-directory directory #!optional force exclude

Compiles all the Lisp files in the directory called directory which either haven’t been compiled or whose compiled version is older than the source file (Lisp files are those ending in ‘.jl’).

If the optional argument force is true all Lisp files will be recompiled whatever the status of their compiled version.

The exclude argument may be a list of filenames, these files will not be compiled.

When this function is called interactively it prompts for the directory.

Command: compile-module module-name

Compiles all uncompiled function definitions in the module named module-name (a symbol).

When called interactively the module name will be prompted for.

Function: run-byte-code byte-codes constants stack

Interprets the string of byte instructions byte-codes with the vector of constants constants.

This function should never be called by hand. The compiler will produce calls to this function when it compiles a form or a function.

There is a second form that byte-code objects can take: a vector whose read syntax includes a preceding ‘#’ character is a byte-code subr. These objects represent compiled Lisp functions and macros.

Function: bytecodep arg

Returns true if arg is a byte-code subroutine.

Next: , Up: Compiled Lisp   [Contents][Index]