ToC DocOverview CGDoc RelNotes Index PermutedIndex
Allegro CL
Home Previous Up Next Table of Contents Index
  ANSI Common Lisp   3 Evaluation and Compilation   3.4 Lambda Lists

3.4.1 Ordinary Lambda Lists

An ordinary lambda list is used to describe how a set of arguments is received by an ordinary function. The defined names in the next figure are those which use ordinary lambda lists:

Standardized Operators that use Ordinary Lambda Lists
define-method-combination handler-case restart-case
defun labels
flet lambda

An ordinary lambda list can contain the lambda list keywords shown in the next figure.

Lambda List Keywords used by Ordinary Lambda Lists
&allow-other-keys &key &rest
&aux &optional

Each element of a lambda list is either a parameter specifier or a lambda list keyword. Implementations are free to provide additional lambda list keywords. For a list of all lambda list keywords used by the implementation, see lambda-list-keywords.

The syntax for ordinary lambda lists is as follows:

lambda-list::= {var}*
 [&optional {var | (var [init-form [supplied-p-parameter ]])}*]
 [&rest var]
 [&key {var | ({var | (keyword-name var)} [init-form [supplied-p-parameter ]])}* [&allow-other-keys]]
 [&aux {var | (var [init-form ])}*]

A var or supplied-p-parameter must be a symbol that is not the name of a constant variable.

An init-form can be any form. Whenever any init-form is evaluated for any parameter specifier, that form may refer to any parameter variable to the left of the specifier in which the init-form appears, including any supplied-p-parameter variables, and may rely on the fact that no other parameter variable has yet been bound (including its own parameter variable).

A keyword-name can be any symbol, but by convention is normally a keyword1; all standardized functions follow that convention.

An ordinary lambda list has five parts, any or all of which may be empty. For information about the treatment of argument mismatches, see Section 3.5 Error Checking in Function Calls.  Specifiers for the required parameters  Specifiers for optional parameters  A specifier for a rest parameter  Specifiers for keyword parameters  Specifiers for aux variables  Examples of Ordinary Lambda Lists

Home Previous Up Next Table of Contents Index
© Franz Inc. 1998-2012 - File last updated 02-24-2012