Dick Hendrickson wrote:
> Otherwise, I suspect it's a matter
> of deciding what should happen if the index changes during loop
> execution.
I can see the complications. However, let me explain why I need this. Often I
have nested do loops traversing each dimension of something and then need an
array which holds all the indices. Now I need to use array constructors or
such:
do i=
do j=
do k=
position=(/i,j,k/)+...
...
Would it not be nice to be able to do:
integer :: i(3)
do i(1)=
do i(2)=
do j(2)=
position=i+...
...
Van has proposed some enhancements to future Fortran versions to allow arrays
as indices into other arrays, so that in the case above one could say
array(i(1:3)) instead of array(i,j,k) or something like that.
It just seems like a restriction that is too strict. Maybe allowing array
elements with constant subscripts or alike would be better...
Thanks,
Aleks
|