[Alexandria-devel] [PATCH] Fix default ARRAY-INDEX and ARRAY-LENGTH.
![](https://secure.gravatar.com/avatar/e7578e6adde6ed5c3235fd5efcf1528b.jpg?s=120&d=mm&r=g)
ARRAY-DIMENSION-LIMIT is an exclusive upper bound. --- types.lisp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/types.lisp b/types.lisp index 6aa722f..1942d0e 100644 --- a/types.lisp +++ b/types.lisp @@ -1,14 +1,14 @@ (in-package :alexandria) -(deftype array-index (&optional (length array-dimension-limit)) +(deftype array-index (&optional (length (1- array-dimension-limit))) "Type designator for an index into array of LENGTH: an integer between -0 (inclusive) and LENGTH (exclusive). LENGTH defaults to +0 (inclusive) and LENGTH (exclusive). LENGTH defaults to one less than ARRAY-DIMENSION-LIMIT." `(integer 0 (,length))) -(deftype array-length (&optional (length array-dimension-limit)) +(deftype array-length (&optional (length (1- array-dimension-limit))) "Type designator for a dimension of an array of LENGTH: an integer between -0 (inclusive) and LENGTH (inclusive). LENGTH defaults to +0 (inclusive) and LENGTH (inclusive). LENGTH defaults to one less than ARRAY-DIMENSION-LIMIT." `(integer 0 ,length)) -- 1.7.9.5
![](https://secure.gravatar.com/avatar/4fd19de0b3e4891247e0056c282337c4.jpg?s=120&d=mm&r=g)
On Fri, Jul 25, 2014 at 5:51 PM, James M. Lawrence <llmjjmll@gmail.com> wrote:
ARRAY-DIMENSION-LIMIT is an exclusive upper bound. --- types.lisp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
pushed, thanks! -- • attila lendvai • PGP: 963F 5D5F 45C7 DFCD 0A39 -- “The kind of man who demands that government enforce his ideas is always the kind whose ideas are idiotic.” — H.L. Mencken (1880–1956)
participants (2)
-
Attila Lendvai
-
James M. Lawrence