Project:Common Lisp/Guide

Implementations
One of the great things about Common Lisp is the variety of quality implementions avaiable. Gentoo supports the following free software implementations:

Libraries
As of writing, there are over two-hundred Common Lisp libraries supported in Gentoo. All Common Lisp libraries in Gentoo are made available within the dev-lisp

Each ebuild name begins with the "cl-" prefix for historical reasons. If the name of the library upstream does not begin with "cl-", then "cl-" is prefixed to create the Gentoo ebuild name. eg. "araneida" becomes "cl-araneida". If the name of the library upstream begins with "cl-", then the Gentoo ebuild name will be the same. eg. "cl-ppcre".

Integration of Implementations and Libraries
Under the Common Lisp Controller scheme, each implementation includes code for redirection of compilation output (FASL files. The Common Lisp Controller code is saved in the Lisp implementation's image (or initialization) at emerge and is present when the user starts the Lisp implementation. Refer to the Common Lisp Controller documentation for more detail.

Using Common Lisp Without the Common Lisp Controller
The most important feature of the Common Lisp Controller from our distribution's standpoint is the redirection of compiled output from source files located in user read-only directories under to a user-writable path. This feature can be achieved using the ASDF Binary Locations extension to ASDF.

The first step is to install ASDF and ASDF Binary Locations if your choice of Common Lisp implementation does not come bundled with ASDF. SBCL and ECL currently bundle ASDF.

Create a Gentoo Common Lisp initialization file somewhere in your home directory. You might call the file perhaps. You could include this initialization code directly in your Lisp implementation's initialization file (eg., , etc.), but it will make more sense to include it from an external file if you work with more than one implementation. The first thing our initialization code must do is load ASDF:

If the implementation includes ASDF then you may need to load it using the implementation a specific REQUIRE. If the implemention doesn't include ASDF then we load it directly. The next step is to configure ASDF to use the Portage-installed Common Lisp libraries and then load ASDF Binary Locations:

Portage currently creates a directory of symlinks which point to ASDF system definition files (*.asd) in  rather than adding a path to each individual ASDF system definition file.

Finally, ASDF Binary Locations needs to be configured. We want all compiled output to be centralized under one user read-writable directory so we set ASDF:*CENTRALIZE-LISP-BINARIES* to true. By default, compiled output will be stored in a directory structure under. Some Common Lisp implementations, such as SBCL, use ASDF internally. We want to avoid interfering with that behaviour, therefore we configure ASDF Binary Locations to do nothing for definitions belonging to SBCL. This can be achieved by including the SBCL path in ASDF:*SOURCE-TO-TARGET-MAPPINGS*.

The following examples show how to use gentoo-init.lisp from various Common Lisp implementations. Note how ASDF system definitions are being found under and compiled to, for example,.

From SBCL:

From CLISP:

The Gentoo-Maintained gentoo-init.lisp
Now that you understand how integration of Common Lisp implementations and libraries is achieved in Gentoo, you might want to install the ready-made which will install  to  for you. You could then load the file from your implementation's initialization file.

CMUCL Changes
Prior to dev-lisp/cmucl-19d_pre1, the Common Lisp Controller enabled CMUCL installation would also include a number of ASDF system definitions to wrap various CMUCL subsystems. With the inclusion of dev-lisp/cmucl-19d_pre1, subsystems are not wrapped by ASDF -- subsystems are loaded the CMUCL way via CMUCL's Extension to REQUIRE.

If you previously used those ASDF components in your own ASDF system definition files, you'll need to remove them and instead conditionally load the appropriate CMUCL subsystem. For example:

Load the subsystem conditionally: