《通链参考手册》


Function ARRAY-DISPLACEMENT

●语法设定:

array-displacement array => displaced-to, displaced-index-offset

●参数和值:

array---an array.

displaced-to---an array or nil.

displaced-index-offset---a non-negative fixnum.

●详情:

If the array is a displaced array, returns the values of the :displaced-to and :displaced-index-offset options for the array (see the functions make-array and adjust-array). If the array is not a displaced array, nil and 0 are returned.

If array-displacement is called on an array for which a non-nil object was provided as the :displaced-to argument to make-array or adjust-array, it must return that object as its first value. It is implementation-dependent whether array-displacement returns a non-nil primary value for any other array.

●例子:

 (setq a1 (make-array 5)) =>  #<ARRAY 5 simple 46115576>
 (setq a2 (make-array 4 :displaced-to a1
                        :displaced-index-offset 1))
=>  #<ARRAY 4 indirect 46117134>
 (array-displacement a2)
=>  #<ARRAY 5 simple 46115576>, 1
 (setq a3 (make-array 2 :displaced-to a2
                        :displaced-index-offset 2))
=>  #<ARRAY 2 indirect 46122527>
 (array-displacement a3)
=>  #<ARRAY 4 indirect 46117134>, 2

●受制于: 无。

●例外情况:

Should signal an error of type type-error if array is not an array.

●更多信息:

make-array

●说明: 无。


X3J13设计清单非标准部分,可查下面章节:


◇首页 § ◎章节目录 § □内容索引 § ○符号索引 § △术语表 § ※设计草案