User Tools


Differences

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

Link to this comparison view

cl:functions:vector [2019/11/11 05:00]
cl:functions:vector [2019/11/22 14:00] (current)
Line 1: Line 1:
 +====== Function VECTOR ======
 +
 +====Syntax====
 +  * **vector** //''&​rest''​ objects// → //vector//
 +
 +====Arguments and Values====
 +  * //object// - an //​[[CL:​Glossary:​object]]//​.
 +  * //vector// - a //​[[CL:​Glossary:​vector]]//​ of //​[[CL:​Glossary:​type]]//​ ''​(vector [[CL:​Types:​t]] **[[CL:​Types:​*]]**)''​.
 +
 +====Description====
 +Creates a //​[[CL:​Glossary:​fresh]]//​ //​[[CL:​Glossary:​simple general vector]]// whose size corresponds to the number of //​objects//​.
 +
 +The //​[[CL:​Glossary:​vector]]//​ is initialized to contain the //​objects//​.
 +
 +====Examples====
 +
 +<​blockquote>​
 +([[CL:​Macros:​defparameter]] *v* (vector 1 2 '​sirens)) <​r>​*V*</​r>​
 +([[CL:​Functions:​arrayp]] *v*) <​r>//​[[CL:​Glossary:​true]]//</​r> ​
 +([[CL:​Functions:​vectorp]] *v*) <​r>//​[[CL:​Glossary:​true]]//</​r> ​
 +([[CL:​Functions:​simple-vector-p]] *v*) <​r>//​[[CL:​Glossary:​true]]//</​r> ​
 +([[CL:​Functions:​length]] *v*) <​r>​3</​r>​
 +</​blockquote>​
 +
 +====Side Effects====
 +None.
 +
 +====Affected By====
 +None.
 +
 +====Exceptional Situations====
 +None.
 +
 +====See Also====
 +**[[CL:​Functions:​make-array|Function MAKE-ARRAY]]**
 +
 +====Notes====
 +**[[CL:​Functions:​vector]]** is analogous to **[[CL:​Functions:​list]]**.
 +
 +<​blockquote>​
 +(vector a<​sub>​1</​sub>​ a<​sub>​2</​sub>​ ... a<​sub>​n</​sub>​) ​
 +  ≡ ([[CL:​Functions:​make-array]] ([CL:​Functions:​list]] ''​n''​) ​
 +                :​element-type [[CL:​Types:​t]] ​
 +                :​initial-contents (list a<​sub>​1</​sub>​ a<​sub>​2</​sub>​ ... a<​sub>​n</​sub>​)))
 +</​blockquote>​