diff --git a/arrays.lisp b/arrays.lisp index 11946187661ac69e6c66fa7721fcd55d01d7a882..0368dc74480d2960a94f5f0dd99a0bb3edc6c3ed 100644 --- a/arrays.lisp +++ b/arrays.lisp @@ -1,10 +1,17 @@ (in-package :alexandria) (deftype array-index (&optional (length array-dimension-limit)) - "Type designator for an array of LENGTH: an integer between 0 (inclusive) and -LENGTH (exclusive). LENGTH defaults to ARRAY-DIMENSION-LIMIT." + "Type designator for an index into array of LENGTH: an integer between +0 (inclusive) and LENGTH (exclusive). LENGTH defaults to +ARRAY-DIMENSION-LIMIT." `(integer 0 (,length))) +(deftype array-length (&optional (length array-dimension-limit)) + "Type designator for a dimension of an array of LENGTH: an integer between +0 (inclusive) and LENGTH (inclusive). LENGTH defaults to +ARRAY-DIMENSION-LIMIT." + `(integer 0 ,length)) + (defun copy-array (array &key (element-type (array-element-type array)) (fill-pointer (and (array-has-fill-pointer-p array) diff --git a/package.lisp b/package.lisp index f2d3990d2d12e0d96c824310803f572c823fb21f..f539fc9d0e85396209833ccc1a2a90eb78045d7d 100644 --- a/package.lisp +++ b/package.lisp @@ -72,6 +72,7 @@ #:standard-deviation ;; Arrays #:array-index + #:array-length #:copy-array ;; Sequences #:emptyp