common-lisp

ANSI Common Lisp, the language standard and its documentation

Common Lisp HyperSpec

Common Lisp has a standard, which was initially published in 1994 as an ANSI standard.

The Common Lisp HyperSpec, short CLHS, provided by LispWorks is an often used HTML documentation, which is derived from the standard document. The HyperSpec can also be downloaded and locally used.

Common Lisp development environments usually allow lookup of the HyperSpec documentation for Lisp symbols.

See also: cliki on CLHS

EBNF syntax declarations in documentation

The ANSI CL standard uses an extended EBNF syntax notation. The documentation duplicated on Stackoverflow should use the same syntax notation to reduce confusion.

Example:

specialized-lambda-list::=
     ({var | (var parameter-specializer-name)}* 
      [&optional {var | (var [initform [supplied-p-parameter] ])}*] 
      [&rest var] 
      [&key{var | ({var | (keywordvar)} [initform [supplied-p-parameter] ])}*
           [&allow-other-keys] ] 
      [&aux {var | (var [initform] )}*] ) 

Notation:

  • [foo] -> zero or one foo
  • {foo}* -> zero or more foo
  • foo | bar ->foo or bar

Common Lisp the Language, 2nd Edition, by Guy L. Steele Jr.

This book is known as CLtL2.

This is the second edition of the book Common Lisp the Language. It was published in 1990, before the ANSI CL standard was final. It took the original language definition from the first edition (published in 1984) and described all changes in the standardization process up to 1990 plus some extensions (like the SERIES iteration facility).

Note: CLTL2 describes a version of Common Lisp which is slightly different from the published standard from 1994. Thus always use the standard, and not CLtL2, as a reference.

CLtL2 still can be useful, because it provides information not found in the Common Lisp specification document.

There is a HTML version of Common Lisp the Language, 2nd Edition.

CLiki - Proposed ANSI Revisions and Clarifications

On CLiki, a Wiki for Common Lisp and free Common Lisp software, a list of Proposed ANSI Revisions and Clarifications is being maintained.

Since the Common Lisp standard has not changed since 1994, users have found several problems with the specification document. These are documented on the CLiki page.

Common Lisp Quick Reference

The Common Lisp Quick Reference is a document which can be printed and bound as a booklet in various layouts to have a printed quick reference for Common Lisp.

The ANSI Common Lisp standard in Texinfo format (especially useful for GNU Emacs)

GNU Emacs uses a special format for documentation: info.

The Common Lisp standard has been converted to the Texinfo format, which can be used to create documentation browsable with the info reader in GNU Emacs.

See here: dpans2texi.el converts the TeX sources of the draft ANSI Common Lisp standard (dpANS) to the Texinfo format.

Another version has been done for for GCL: gcl.info.tgz.


This modified text is an extract of the original Stack Overflow Documentation created by the contributors and released under CC BY-SA 3.0 This website is not affiliated with Stack Overflow