User Tools


Differences

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

Link to this comparison view

cl:functions:elt [2019/07/14 17:00]
cl:functions:elt [2019/10/17 13:00] (current)
Line 1: Line 1:
 +====== Accessor ELT ======
 +
 +====Syntax====
 +  * **elt** //sequence index// → //​object// ​
 +  * (**setf** (**elt** //sequence index//) //​new-object//​)
 +
 +====Arguments and Values====
 +  * //​sequence//​ - a //​[[CL:​Glossary:​proper sequence]]//​.
 +  * //index// - a //​[[CL:​Glossary:​valid sequence index]]// for //​sequence//​.
 +  * //object// - an //​[[CL:​Glossary:​object]]//​.
 +  * //​new-object//​ - an //​[[CL:​Glossary:​object]]//​.
 +
 +====Description====
 +//​[[CL:​Glossary:​access|Accesses]]//​ the //​[[CL:​Glossary:​element]]//​ of //​sequence//​ specified by //index//.
 +
 +====Examples====
 +<​blockquote> ​
 +([[CL:​Macros:​defparameter]] *str* ([[CL:​Functions:​copy-seq]] "​0123456789"​)) <​r>​*STR*</​r>​
 +(elt *str* 6) <​r>#​\6 </r>
 +([[CL:​Macros:​setf]] (elt *str* 0) #\#) <​r>#​\#​ </r>
 +*str* <​r>"#​123456789"​ </r>
 +</​blockquote>​
 +
 +====Side Effects====
 +None.
 +
 +====Affected By====
 +None.
 +
 +====Exceptional Situations====
 +Should be prepared to signal an error of type type-error if //​sequence//​ is not a //​[[CL:​Glossary:​proper sequence]]//​. Should signal an error of type type-error if //index// is not a //​[[CL:​Glossary:​valid sequence index]]// for //​sequence//​.
 +
 +====See Also====
 +  * **[[CL:​Functions:​aref|Function AREF]]**
 +  * **[[CL:​Functions:​nth|Function NTH]]**
 +  * {\secref\ConstantModification}
 +
 +====Notes====
 +**[[CL:​Functions:​aref]]** may be used to //​[[CL:​Glossary:​access]]//​ //​[[CL:​Glossary:​vector]]//​ elements that are beyond the //​[[CL:​Glossary:​vector]]//'​s //​[[CL:​Glossary:​fill pointer]]//​.
 +
 +\issue{CONSTANT-MODIFICATION:​DISALLOW}