Customization

Other topics

More features for the Read-Eval-Print-Loop (REPL) in a terminal

CLISP has an integration with GNU Readline.

For improvements for other implementations see: How to customize the SBCL REPL.

Initialization Files

Most Common Lisp implementations will try to load an init file on startup:

ImplementationInit fileSite/System Init file
ABCL$HOME/.abclrc
Allegro CL$HOME/.clinit.cl
ECL$HOME/.eclrc
Clasp$HOME/.clasprc
CLISP$HOME/.clisprc.lisp
Clozure CLhome:ccl-init.lisp or home:ccl-init.fasl or home:.ccl-init.lisp
CMUCL$HOME/.cmucl-init.lisp
LispWorks$HOME/.lispworks
MKCL$HOME/.mkclrc
SBCL$HOME/.sbclrc$SBCL_HOME/sbclrc or /etc/sbclrc
SCL$HOME/.scl-init.lisp

Sample Initialization files:

ImplementationSample Init file
LispWorksLibrary/lib/7-0-0-0/config/a-dot-lispworks.lisp

Optimization settings

Common Lisp has a way to influence the compilation strategies. It makes sense to define your preferred values.

Optimization values are between 0 (unimportant) and 3 (extremely important). 1 is the neutral value.

It's useful to always use safe code (safety = 3) with all runtime checks enabled.

Note that the interpretation of values is implementation specific. Most Common Lisp implementations make some use of these values.

SettingExplanationuseful default valueuseful delivery value
compilation-speedspeed of the compilation process20
debugease of debugging21 or 0
safetyrun-time error checking32
spaceboth code size and run-time space22
speedspeed of the object code23

An optimize declaration for use with declaim, declare and proclaim:

(optimize (compilation-speed 2)
          (debug 2)
          (safety 3)
          (space 2)
          (speed 2))

Note that you can also apply special optimization settings to portions of the code in a function using the macro LOCALLY.

Contributors

Topic Id: 5679

Example Ids: 20144,20147,20149

This site is not affiliated with any of the contributors.