[cdr-discuss] CDR 5

Nikodemus Siivola nikodemus at random-state.net
Sat Mar 1 12:21:02 UTC 2008


On 2/29/08, Marco Antoniotti <marcoxa at cs.nyu.edu> wrote:

>  There is no stating in the ANSI spec that ARRAY-DIMENSION-LIMIT = or /
>  = or < or <= ARRAY-TOTAL-SIZE-LIMIT.  AFAIU, the latter is guaranteed
>  to be the maximum number of elements in an array as per the glossary
>  entry about "array total size" (always implementation dependent).

>From the ARRAY-TOTAL-SIZE-LIMIT dictionary entry:

"The actual limit on the array total size imposed by the
implementation might vary according the element type of the array; in
this case, the value of array-total-size-limit will be the smallest of
these possible limits."

which IMO makes it unsuitable for this type. ARRAY-DIMENSION-LIMIT
OTOH doesn't carry these weasel-words, which in my interpretation
means that it is the greatest of the possible limits.

(But the distinction is somewhat academic, I grant you. In eg. SBCL
both A-D-L and A-T-S-L are MOST-POSITIVE-FIXNUM, though arguably at
least A-T-S-L should be smaller then that.)

>  The real issue I am not sure about is whether to include or not the
>  limit.  It has been known for DOTIMES to expand in such a way to make
>  the counter (at least internally) reach the limit.

In that I would prefer another name -- since ARRAY-INDEX is not a descriptive
one anymore. ARRAY-DIMENSION would be more correct then.

>  In any case that was my unstated rationale for the definition.  If
>  people are more confortable using ARRAY-DIMENSION-LIMIT.  In this
>  case, I think the definition should look like
>
>         (deftype array-index ()
>             `(integer 0 (,array-dimension-limit)))
>
>  as A-D-L is already the upper exclusive limit.

...for dimension, not index. :)

Cheers,

 -- Nikodemus



More information about the cdr-discuss mailing list