Looking for better explanations of zero-dimensional and empty arrays.
Bradley Lucier 15 Jun 2022 17:24 UTC
The section on how SRFI 231 differs from SRFI 179 has:
Empty and zero-dimensional arrays are incorporated into this SRFI. It is
an error to call the setter or getter of an empty array.
Zero-dimensional arrays specify their sole element with an empty
multi-index.
Under "Notes" there is this paragraph:
Empty and zero-dimensional arrays: The vectors of upper and lower bounds
of an interval can have zero elements, in which case the
zero-dimensional interval itself has no elements, but zero-dimensional
arrays with this domain have getters and setters that take zero indices
as arguments, and which return or set a single element, much like a
Scheme box. If an interval has at least one upper and lower bound, and
at least one of these upper bounds equals the associated lower bound,
then that interval is empty, and arrays with empty intervals as domains
have getters and setters that should raise an exception when called.
I, myself, had a difficult time understanding the "meaning" of empty and
zero-dimensional arrays (as is clear to many of you, I'm sure), and I'm
wondering whether these two brief paragraphs explain the issues
sufficiently.
Brad