[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Adjustable and displaced arrays

I am somewhat confused about the interaction between array adjustment
and displacement.

In CLTL p298:

    Note that if the array a is created displaced to array b and
    subsequently array b is given to adjust-array, array a will still
    be displaced to array b; the effects of this displacement and the
    rule of row-major storage order must be taken into account.

What is this trying to say?  Is this a warning to the user or a threat
to the implementor?  The obvious interpretation of this statement
seems to require that all non-simple arrays contain a list of all the
other array headers that share the same data so that they can be fixed
up when the array is adjusted.  The answer that you stick in a
forwarding pointer is not acceptable.

The statement in the manual also doesn't answer the question of what
happens to array b if array a is adjusted.  Is it legal or meaningful
to have arrays which are both displaced to another array and
adjustable?  What are the semantics of adjusting such an array?