User Tools


Differences

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

Link to this comparison view

cl:functions:fill-pointer [2019/06/15 02:00]
cl:functions:fill-pointer [2019/06/18 10:00] (current)
Line 1: Line 1:
 +====== Accessor FILL-POINTER ======
 +
 +====Syntax====
 +  * **fill-pointer** //vector// → //​fill-pointer// ​
 +  * (**setf** (**fill-pointer** //vector//) //​new-fill-pointer//​)
 +
 +====Arguments and Values====
 +  * //vector// - a //​[[CL:​Glossary:​vector]]//​ with a //​[[CL:​Glossary:​fill pointer]]//​.
 +  * //​fill-pointer//,​ //​new-fill-pointer//​ - a //​[[CL:​Glossary:​valid fill pointer]]// for the //vector//.
 +
 +====Description====
 +//​[[CL:​Glossary:​access|Accesses]]//​ the //​[[CL:​Glossary:​fill pointer]]// of //vector//.
 +
 +====Examples====
 +<​blockquote> ​
 +([[CL:​Macros:​defparameter]] *array* ([[CL:​Functions:​make-array]] 8 :​fill-pointer 4)) <​r>​*ARRAY*</​r>​
 +*array* <​r>#​(NIL NIL NIL NIL) </r>
 +(fill-pointer *array*) <r>4 </r>
 +
 +([[CL:​Macros:​dotimes]] (i ([[CL:​Functions:​length]] *array*))
 +  ([[CL:​Macros:​setf]] ([[CL:​Functions:​aref]] *array* i) (* i i))) <​r>​NIL</​r>​
 +*array* <​r>#​(0 1 4 9)</​r>​
 +
 +([[CL:​Macros:​setf]] (fill-pointer *array*) 3) <r>3 </r>
 +(fill-pointer *array*) <r>3 </r>
 +*array* <​r>#​(0 1 4)</​r>​
 +
 +([[CL:​Macros:​setf]] (fill-pointer *array*) 8) <r>8 </r>
 +*array* <​r>#​(0 1 4 9 NIL NIL NIL NIL) </r>
 +</​blockquote>​
 +
 +====Side Effects====
 +None.
 +
 +====Affected By====
 +None.
 +
 +====Exceptional Situations====
 +Should signal an error of type type-error if //vector// is not a //​[[CL:​Glossary:​vector]]//​ with a //​[[CL:​Glossary:​fill pointer]]//​.
 +
 +====See Also====
 +**[[CL:​Functions:​make-array|Function MAKE-ARRAY]]**,​ **[[CL:​Functions:​length|Function LENGTH]]**
 +
 +====Notes====
 +There is no //​[[CL:​Glossary:​operator]]//​ that will remove a //​[[CL:​Glossary:​vector]]//'​s //​[[CL:​Glossary:​fill pointer]]//​.