User Tools

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

====== Function ARRAY-DISPLACEMENT ====== ====Syntax==== * **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]]//. ====Description==== 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//. ====Examples==== <blockquote> ([[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> 1 </r> ([[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> </blockquote> ====Affected By==== None. ====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]]** ====Notes==== None. \issue{DISPLACED-ARRAY-PREDICATE:ADD}