chickadee » srfi-179 » array-extract

array-extract array new-domainprocedure

Returns a new array with the same getter (and setter, if appropriate) of the first argument, defined on the second argument.

Assumes that array is an array and new-domain is an interval that is a sub-interval of (array-domain array). If array is a specialized array, then returns

  (specialized-array-share array
                           new-domain
                           values)
  

Otherwise, if array is a mutable array, then array-extract returns

  (make-array new-domain
              (array-getter array)
              (array-setter array))

Finally, if array is an immutable array, then array-extract returns

  (make-array new-domain
              (array-getter array))

It is an error if the arguments of array-extract do not satisfy these conditions.

If array is a specialized array, the resulting array inherits its mutability and safety from array.