User Tools


Differences

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

Link to this comparison view

cl:functions:vector-pop [2019/09/14 05:00]
cl:functions:vector-pop [2019/09/20 16:00] (current)
Line 1: Line 1:
 +====== Function VECTOR-POP ======
 +
 +====Syntax====
 +  * **vector-pop** //vector// → //element//
 +
 +====Arguments and Values====
 +  * //vector// - a //​[[CL:​Glossary:​vector]]//​ with a //​[[CL:​Glossary:​fill pointer]]//​.
 +  * //element// - an //​[[CL:​Glossary:​object]]//​.
 +
 +====Description====
 +Decreases the //​[[CL:​Glossary:​fill pointer]]// of //vector// by one, and retrieves the //​[[CL:​Glossary:​element]]//​ of //vector// that is designated by the new //​[[CL:​Glossary:​fill pointer]]//​.
 +
 +====Examples====
 +
 +<​blockquote>​
 +([[CL:​Macros:​defparameter]] *fable* (list '​fable)) <​r>​*FABLE*</​r>​
 +([[CL:​Macros:​defparameter]] *fa* ([[CL:​Functions:​make-array]] 8 :​fill-pointer 2 :​initial-element '​sisyphus)) <​r>​*FA*</​r>​
 +([[CL:​Functions:​vector-push]] *fable* *fa*) <​r>​2</​r> ​
 +([[CL:​Functions:​fill-pointer]] *fa*) <​r>​3</​r> ​
 +([[CL:​Functions:​eq]] (vector-pop *fa*) *fable*) <​r>//​[[CL:​Glossary:​true]]//​ </r>
 +(vector-pop *fa*) <​r>​SISYPHUS</​r> ​
 +([[CL:​Functions:​fill-pointer]] *fa*) <​r>​1</​r> ​
 +</​blockquote>​
 +
 +====Side Effects====
 +The //​[[CL:​Glossary:​fill pointer]]// is decreased by one.
 +
 +====Affected By====
 +The value of the //​[[CL:​Glossary:​fill pointer]]//​.
 +
 +====Exceptional Situations====
 +An error of type **[[CL:​Types:​type-error]]** is signaled if //vector// does not have a //​[[CL:​Glossary:​fill pointer]]//​.
 +
 +If the //​[[CL:​Glossary:​fill pointer]]// is zero, **[[CL:​Functions:​vector-pop]]** signals an error of type **[[CL:​Types:​error]]**.
 +
 +====See Also====
 +**[[CL:​Functions:​vector-push|Function VECTOR-PUSH]]**,​ **[[CL:​Functions:​vector-push-extend|Function VECTOR-PUSH-EXTEND]]**,​ **[[CL:​Functions:​fill-pointer|Function FILL-POINTER]]**
 +
 +====Notes====
 +None.