[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: should allow empty arrays
Can you tell me how I might remove my name from this waste of my time
From: Per Bothner [mailto:per@xxxxxxxxxxx]
Sent: Tuesday, November 13, 2001 9:44 AM
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"
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
(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)).