.
But it is specified to the user in the detailed explanation of
such an array operation. So would still be appropriate to raise
the SUBSCRIPTRANGE condition.
> And the object code penalty would be obscene to
> evaluate each individual case
.
No need to evaluate each individual case.
In any case, even if this were done, it would not be any worse
compared with the equivalent piece of code written with
explicit DO loops.
.
> when it can be checked by LBOUND = LBOUND
> and HBOUND = HBOUND.
.
Of course it can, and that is the obvious way to do it (as I already
suggested below).
.
> As far as I can tell, IBM PL/I has worked the way
> it does now for over 50 years, so I don’t think you’ll see a change, but
> if you want to submit it to IBM, you’re welcome to try. And I suggest
> you suggest, at least as a alternative, a new ON-condition, perhaps to
> be named ARRAYRANGE or at least a new ONCODE value.
.
No need to introduce yet more conditions / keywords.
.
> (I’m in no position
> to do it; I have 30 years of experience with PL/I on DOS/360 and OS/360
> and their descendants (and a little on OS/2), but I live in the Apple
> world nowadays, and am far more interested in Swift and Cocoa.
.
> > At the very least, any bounds check ought to be carried out
> > once prior to executing code for the operation.
> > .
> >> given that any sensible
> >> user will check either file input or parameter values early on, so as to
> >> give a meaningful diagnostic.
> > .
> > A user would only know to include such a check if it were stated in the manual
> > that a check would not be carried out by the compiler. (or, if he/she
> > discovered it by accident).
.
> Still smarter to do reasonableness checks first,
.
but only if the programmer sees such limitation spelled out in the manual --
which it wasn't (or discovered it by accident).
.
In the case of procedures to which arguments might be passed,
it's very sensible to do that.
.
> so that the data error
> is expressed to the user in a user-readable form that explains that
> there is an input error,
.
Indeed.
.
> instead of a mysterious IBM error message that
> can only be interpreted by the original programmer.
.
It can be interpreted by any programmer.