[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: should allow empty arrays

This page is part of the web mail archives of SRFI 25 from before July 7th, 2015. The new archives for SRFI 25 contain all messages, not just those from before July 7th, 2015.

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:per@xxxxxxxxxxx]
Sent: Tuesday, November 13, 2001 9:44 AM
To: srfi-25@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
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
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