On Fri, Mar 18, 2011 at 5:58 PM, Matthew Mondor <email@example.com> wrote:
When looking at the HyperSpec on those functions, it seems undefined
what happens when a supplied index is not a "valid array index", thus,
from 0 below the array size. The exception is ELT, which should signal
a condition of type TYPE-ERROR.
In practice however, it seems that implementations attempt to signal an
error condition for invalid index access.
In SBCL, AREF, SVREF, CHAR, SCHAR will signal a uniform condition of
Index 4 out of bounds for <insert array type here>,
should be nonnegative and <<insert size here>.
Although a different behaviour for ELT:
The index 4 is too large. [SB-KERNEL:INDEX-TOO-LARGE-ERROR]
For ECL, the condition type and error message varies, and SVREF even
behaves differently than the others:
CHAR, SCHAR: [SIMPLE-ERROR]
SVREF: (this differs in interpreted and compiled mode)
Interpreted mode: In function SVREF, the index into the object 4. takes a value #(1 2 3) out of the range (INTEGER 0 2). [SIMPLE-TYPE-ERROR]
Compiled mode: Returns the supplied vector instead of signaling an error.