User Tools


Function ARRAY-IN-BOUNDS-P

Syntax

  • array-in-bounds-p array &rest subscriptsgeneralized-boolean

Arguments and Values

Description

Returns true if the subscripts are all in bounds for array; otherwise returns false. (If array is a vector with a fill pointer, that fill pointer is ignored.)

Examples

(defparameter *array* (make-array '(7 11) :element-type 'base-char))

*ARRAY*

(array-in-bounds-p *array* 0 0)

true

(array-in-bounds-p *array* 6 10)

true

(array-in-bounds-p *array* 0 -1)

false

(array-in-bounds-p *array* 0 11)

false

(array-in-bounds-p *array* 7 0)

false

Affected By

None.

Exceptional Situations

None.

See Also

Notes

(array-in-bounds-p array subscripts) ≡ (and (not (some #'minusp (list subscripts))) (every #'less (list subscripts) (array-dimensions array)))