RE: should allow empty arrays Brian Denney 13 Nov 2001 17:46 UTC

Herr Buttner,

	Can you tell me how I might remove my name from this waste of my time
mailing list?

-----Original Message-----
>From: Per Bothner [mailto:xxxxxx@bothner.com]
Sent: Tuesday, November 13, 2001 9:44 AM
To: srfi-25@rotkohl.informatik.uni-tuebingen.de
Subject: should allow empty arrays

 > The lower bound b and the upper bound e of a dimension are exact
integers with |(<= b e)|.

This should be (<= b (- e 1)) if you believe in APL, which has "always"
allowed
0-element arrays.  So does Common Lisp.  I think we should too,

If you allow 0 in a dimension it may be more convenient to represent a
shape as:
(list of length), (list of lower-bound)
instead of: list of (lower-bound, upper-bound)
use:  (list of length), (list of lower-bound)
I.e. instead of the shape being (0 2 0 3) it would be ((0 0) (3 4)).

One option for the shape function would be:
(shape lower-bound length ...)
where lower-bound is either a list or an integer.  The latter is
short-hand for a list where all lower bounds are the same.
One main advantage of this is that you normally don't
need explicit calls to list: (shape 0 3 4) yields ((0 0) (3 4)).

    --Per Bothner