[cdr-discuss] CDR 5

Marco Antoniotti marcoxa at cs.nyu.edu
Sat Mar 1 07:31:13 UTC 2008


Actually the example may not be all that appropriate.  In any case,  
that were my considerations.  Do let me know if there is a strong  
preference versus A-D-L or otherwise.  Also let me hear your thoughts  
about including or not the upper limit.

Cheers

Marco



On Feb 29, 2008, at 11:52 , Marco Antoniotti wrote:

> Hi
>
> It may, but I find it debatable.
>
> 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).  This will warrant things like
>
> 	(defvar a (make-array (list d1 d2 ... dn)))
>
> 	(defvar da (make-array (reduce '* (array-dimensions a)) :displaced- 
> to a))
>
> 	;;; looping over da
>
> My gut feeling is that this is a foggy corner of the ANSI spec.   
> Given the above example, I would surmise that ARRAY-DIMENSION-LIMIT  
> = ARRAY-TOTAL-SIZE-LIMIT is implied by the ANSI spec, but that may  
> or may not be the case.
>
> 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 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.
>
> Cheers
>
> Marco
>
>
>
>
>
>
> On Feb 28, 2008, at 12:09 , Nikodemus Siivola wrote:
>
>> The ARRAY-INDEX definition seems slightly suspect -- I believe it  
>> should be:
>>
>>  (deftype array-index ()
>>    `(integer 0 (,(1- array-dimension-limit))))
>>
>> Cheers,
>>
>>  -- Nikodemus
>> _______________________________________________
>> cdr-discuss mailing list
>> cdr-discuss at common-lisp.net
>> http://common-lisp.net/cgi-bin/mailman/listinfo/cdr-discuss
>
> --
> Marco Antoniotti
>
>
> _______________________________________________
> cdr-discuss mailing list
> cdr-discuss at common-lisp.net
> http://common-lisp.net/cgi-bin/mailman/listinfo/cdr-discuss

--
Marco Antoniotti





More information about the cdr-discuss mailing list