User Tools


Differences

This shows you the differences between two versions of the page.

Link to this comparison view

cl:functions:identity [2019/11/11 05:00]
cl:functions:identity [2019/12/15 08:00] (current)
Line 1: Line 1:
 +====== Function IDENTITY ======
 +
 +====Syntax====
 +  * **identity** //object// → //object//
 +
 +====Arguments and Values====
 +  * //object// - an //​[[CL:​Glossary:​object]]//​.
 +
 +====Description====
 +Returns its argument //object//.
 +
 +====Examples====
 +<​blockquote>​
 +(identity 101) <​r>​101</​r>​
 +([[CL:​Functions:​mapcan]] #'​identity ([[CL:​Functions:​list]] ([[CL:​Functions:​list]] 1 2 3) '(4 5 6))) <r>(1 2 3 4 5 6)</​r>​
 +</​blockquote>​
 +
 +====Side Effects====
 +None.
 +
 +====Affected By====
 +None.
 +
 +====Exceptional Situations====
 +None.
 +
 +====See Also====
 +None.
 +
 +====Notes====
 +**[[CL:​Functions:​identity]]** is intended for use with functions that require a //​[[CL:​Glossary:​function]]//​ as an argument.
 +
 +''​([[CL:​Functions:​eql]] x (identity x))''​ returns //​[[CL:​Glossary:​true]]//​ for all possible values of //x//, but ''​([[CL:​Functions:​eq]] x (identity x))''​ might return //​[[CL:​Glossary:​false]]//​ when //x// is a //​[[CL:​Glossary:​number]]//​ or //​[[CL:​Glossary:​character]]//​.
 +
 +**[[CL:​Functions:​identity]]** could be defined by:
 +
 +<​blockquote>​
 +([[CL:​Macros:​defun]] identity (x) x)
 +</​blockquote>​
 +