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

adjust-array with :initial-elements and fill pointers



Consider the following forms:

  (setq a (make-array 5 :fill-pointer 3))
  (adjust-array a 7 :initial-element 'b)

What should happen?  On page 297, it says "The elements of the new array
that are not in the bounds of array are initalized to the
:initial-element".  The question is whether the elements that follow the
fill pointer are considered to be within the "bounds of the array".  The
sentence on page 295, "Nearly all functions that operate on the contents
of a vector will operate only on the active elements", is what makes
this issue less than perfectly clear.

Our recommendation is that the entire new array be initialized, despite
the presence of the fill pointer, and that adjust-array be clearly
designated as one of the exceptions to the "nearly all" phrase.