User Tools


Differences

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

Link to this comparison view

cl:functions:listp [2019/06/15 02:00]
cl:functions:listp [2019/08/17 15:00] (current)
Line 1: Line 1:
 +====== Function LISTP ======
 +
 +====Syntax====
 +  * **listp** //object// → //​generalized-boolean//​
 +
 +====Arguments and Values====
 +  * //object// - an //​[[CL:​Glossary:​object]]//​.
 +  * //​generalized-boolean//​ - a //​[[CL:​Glossary:​generalized boolean]]//​.
 +
 +====Description====
 +Returns //​[[CL:​Glossary:​true]]//​ if //object// is of //​[[CL:​Glossary:​type]]//​ **[[CL:​Types:​list]]**;​ otherwise, returns //​[[CL:​Glossary:​false]]//​.
 +
 +====Examples====
 +<​blockquote>​
 +(listp nil) <​r>//​[[CL:​Glossary:​true]]//</​r>​
 +(listp ([[CL:​Functions:​cons]] 1 2)) <​r>//​[[CL:​Glossary:​true]]//</​r>​
 +(listp ([[CL:​Functions:​make-array]] 6)) <​r>//​[[CL:​Glossary:​false]]//</​r>​
 +(listp t) <​r>//​[[CL:​Glossary:​false]]//</​r>​
 +</​blockquote>​
 +
 +====Side Effects====
 +None.
 +
 +====Affected By====
 +None.
 +
 +====Exceptional Situations====
 +None.
 +
 +====See Also====
 +**[[CL:​Functions:​consp|Function CONSP]]**
 +
 +====Example Implementation====
 +<​blockquote>​
 +(listp //​object//​) ​
 +  ≡ ([[CL:​Functions:​typep]] //object// '​[[CL:​types:​list]]) ​
 +  ≡ ([[CL:​Functions:​typep]] //object// '​([[CL:​types:​or]] [[CL:​types:​cons]] [[CL:​types:​null]]))
 +</​blockquote>​
 +
 +====Notes====
 +If //object// is a //​[[CL:​Glossary:​cons]]//,​ **listp** does not check whether //object// is a //​[[CL:​Glossary:​proper list]]//; it returns //​[[CL:​Glossary:​true]]//​ for any kind of //​[[CL:​Glossary:​list]]//​.