24.4 Identity Function

This function is occasionally useful as an argument to other functions that require functions as arguments. (Got that?)

[Function] identity object

The object is returned as the value of identity.

The identity function is the default value for the :key argument to many sequence functions (see chapter 14).

Table 12.1 illustrates the behavior in the complex plane of the identity function regarded as a function of a complex numerical argument.

Many other constructs in Common Lisp have the behavior of identity when given a single argument. For example, one might well use values in place of identity. However, writing values of a single argument conventionally indicates that the argument form might deliver multiple values and that the intent is to pass on only the first of those values.


[Function] constantly object

Returns a function that will always return the object. The returned function takes any number of arguments.


[Macro] lambda lambda-list [[ {declaration}* | [doc-string]] {form}*

A dubious shortcut for (function (lambda ...)) or #’(lambda ...).