Dan Nagle writes:
> That is to say, to guarantee the result of the vector reference
> is a memory referenced of the form "<start> + n * <stride>"
> where is it guaranteed that <start> and <stride> are constant
> numbers.
I'm afraid I don't see how this has any correlation with the question
of arrays of arrays. In the case of slices of rank>1, we don't
have constant stride across the whole slice anyway, even without
arrays of arrays. Consider the slice A(1:2,1:2) where A is a 10x10.
We have a constant stride only for rank 1 slices.
In the case of slices of rank=1, I think they are still constant
stride if you allow arrays of arrays.
Note that this is *NOT* the same restriction as the one that disallows
what I might call "slices through arrays of pointers". There is a
completely separate restriction that disallows that. Otherwise, with
pointers you could have arrays whose elements were in completely
arbitrary order. (Well, we already have that in vector indices,
but their use is very limitted, and it is basically assumed that
the implementation is likely to make a copy of such an array - or
at least the standard makes sure that copying would be a reasonable
implementation). The case in question here involved no pointers...
or if it did, I overlooked them and gave a seriously incomplete
answer because, yes, the constant stride issue is "clearly" a
big one for the pointer case.
--
Richard Maine | Good judgment comes from experience;
[log in to unmask] | experience comes from bad judgment.
| -- Mark Twain
|