User Tools

A PCRE internal error occured. This might be caused by a faulty plugin


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

Link to this comparison view

cl:functions:array-displacement [2019/11/11 05:00]
cl:functions:array-displacement [2020/05/25 18:00] (current)
Line 1: Line 1:
 +====== Function ARRAY-DISPLACEMENT ======
 +  * **array-displacement** //array// → //​displaced-to,​ displaced-index-offset//​
 +====Arguments and Values====
 +  * //array// - an //​[[CL:​Glossary:​array]]//​.
 +  * //​displaced-to//​ - an //array// or **[[CL:​Constant Variables:​nil]]**.
 +  * //​displaced-index-offset//​ - a non-negative //​[[CL:​Glossary:​fixnum]]//​.
 +If the //array// is a //​[[CL:​Glossary:​displaced array]]//, returns the //​[[CL:​Glossary:​values]]//​ of the **'':​displaced-to''​** and **'':​displaced-index-offset''​** options for the //​[[CL:​Glossary:​array]]//​ (see the //​[[CL:​Glossary:​function|functions]]//​ **[[CL:​Functions:​make-array]]** and **[[CL:​Functions:​adjust-array]]**). If the //array// is not a //​[[CL:​Glossary:​displaced array]]//, **[[CL:​Constant Variables:​nil]]** and ''​0''​ are returned.
 +If **array-displacement** is called on an //array// for which a //​[[CL:​Glossary:​non-nil]]//​ //​[[CL:​Glossary:​object]]//​ was provided as the **'':​displaced-to''​** //​[[CL:​Glossary:​argument]]//​ to **[[CL:​Functions:​make-array]]** or **[[CL:​Functions:​adjust-array]]**,​ it must return that //​[[CL:​Glossary:​object]]//​ as its first value. It is //​[[CL:​Glossary:​implementation-dependent]]//​ whether **array-displacement** returns a //​[[CL:​Glossary:​non-nil]]//​ //​[[CL:​Glossary:​primary value]]// for any other //array//.
 +([[CL:​Macros:​defparameter]] *a1* 
 +  ([[CL:​Functions:​make-array]] 5)) <​r>​*A1*</​r>​
 +([[CL:​Macros:​defparameter]] *a2* 
 +  ([[CL:​Functions:​make-array]] 4 :​displaced-to *a1* 
 +                :​displaced-index-offset 1)) <​r>​*A2*</​r>​
 +(array-displacement *a2*)
 +<​r>#<​ARRAY 5 simple 46115576>​
 +([[CL:​Macros:​defparameter]] *a3*
 +  ([[CL:​Functions:​make-array]] 2 :​displaced-to *a2* 
 +                :​displaced-index-offset 2)) <​r>​*A3*</​r>​
 +(array-displacement *a3*) 
 +<​r>#<​ARRAY 4 indirect 46117134>​
 +2</​r> ​
 +====Affected By====
 +====Exceptional Situations====
 +Should signal an error of type type-error if //array// is not an //​[[CL:​Glossary:​array]]//​.
 +====See Also====
 +**[[CL:​Functions:​make-array|Function MAKE-ARRAY]]**