Using vectors of nonnegative exact integers in place of intervals
Bradley Lucier 10 Jul 2024 21:56 UTC
The array routines that take an interval as an argument are:
(make-array interval getter #\[ setter #\])
(make-specialized-array interval #\[ storage-class #\[ initial-value
#\[ safe? #\] #\] #\])
(specialized-array-share array new-domain new-domain->old-domain)
(array-extract array interval))
(list->array interval list #\[ storage-class #\[ mutable? #\[ safe? #\]
#\] #\])
(vector->array interval vector #\[ storage-class #\[ mutable? #\[
safe? #\] #\] #\])
(specialized-array-reshape array interval #\[ copy-on-failure? #f #\])
If there is some derivative document from SRFI 231, it would be
reasonable to allow a programmer to use a vector of exact nonnegative
integers as the "interval" argument to specify an interval with zero
lower bounds and the given vector as upper bounds.
It would require more error checking and copying the elements of the
vector argument to an (immutable) interval structure (to avoid problems
with later mutation of the vector argument).
But it would also allow programmers who don't like intervals to pretend
they don't exist.
Brad