Commit b1c6ee03 authored by James M. Lawrence's avatar James M. Lawrence Committed by Attila Lendvai

Fix default ARRAY-INDEX and ARRAY-LENGTH.

ARRAY-DIMENSION-LIMIT is an exclusive upper bound.
Signed-off-by: Attila Lendvai's avatarAttila Lendvai <attila.lendvai@gmail.com>
parent a019eda8
(in-package :alexandria) (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 "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." ARRAY-DIMENSION-LIMIT."
`(integer 0 (,length))) `(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 "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." ARRAY-DIMENSION-LIMIT."
`(integer 0 ,length)) `(integer 0 ,length))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment