> Currently, the report says nothing about whether an instance
> of Ix should perform bounds checking, or whether this is done
> automatically by the implementation.
>
> My proposal was to say that it should be in the instance
> declaration, which gives the user a variety of options as to
> how to implement bounds checking, including not at all.
>
> The alternative is to say that the implementation itself
> will perform a bounds check, which constrains the implementation
> but guarantees that it always happens.
>
> On pondering this after Joe's question, I find I don't have
> a strong feeling in either direction. But we ought to specify
> which (so that a careful programmer knows whether to include
> bounds checks, or whether the system will provide).
I think it is specified already by the semantics of "array". The fact
that an error results for out-of-bounds indexes implies that a bounds
check must be performed for each array access [in an implementation
without bounds checking, an unexpected defined value could be returned,
which would be incorrect]. As Phil points out, this isn't the most
desirable implementation -- checking on index generation could be
rather more efficient (because indexes may be shared). Given the
serious lack of time, maybe we should just leave it as is?
Kevin