Search Top Index
HELP ARRAYVECTOR John Williams, January 1985 arrayvector(array) -> vectorclass; vectorclass -> arrayvector(array); arrayvector_bounds(array) -> lo_subscript -> hi_subscript; When applied to an array (created by * NEWANYARRAY or * NEWARRAY), the procedure arrayvector returns the vector in which the array elements are stored. The procedure arrayvector_bounds returns the bounds of the portion of this vector used by the array. Normally the bounds are 1 and the length of the vector, but not if the array is displaced to another array or vector. For example: vars a b lo hi; newarray([1 3 1 3], nonop *) -> a; arrayvector(a) => ** {1 2 3 2 4 6 3 6 9} arrayvector_bounds(a) -> lo -> hi; lo => ** 1 hi => ** 9 Now create a displaced array: newanyarray([1 4], a, 3) -> b; arrayvector(b) => ** {1 2 3 2 4 6 3 6 9} arrayvector_bounds(b) => ** 7 4 The updater of arrayvector can be used to replace an array's arrayvector. The new arrayvector must be of the same type as the old, and at least as long as the maximum arrayvector bound. See REF * ARRAYS for a full discussion of arrays in Poplog. --- C.all/help/arrayvector --- Copyright University of Sussex 1988. All rights reserved.