Print

Print


Jan van Oosterwijk writes:
 > At 11:33 30-05-2003 -0700, Richard Maine wrote:
 >
 > >Alvaro Fernandez writes:
 > >  > Can an automatic array have the optional attribute?
 > >
 > >No, but that's because you have the wrong terminology.
 > >An automatic array is never a dummy argument - that's part of the
 > >definition of "automatic".  What you mean is an adjustable array.
 > >Yes, an adjustable array may have the optional attribute.
 >
 >
 > What do you mean by "adjustable array" ?
 > I can't find this term in any (draft) version of the standard.

So I see.  The term appears to have dropped out of the standard as of
f90.  That's probably (I speculate) because they are less of a special
case as of f90, so there isn't much to say about them and a special
term isn't needed.  They are mostly something like "explicit-shape
arrays that are not automatic arrays or function return variables and
that have bounds that are not initialization expressions."

In f77, they are defined (using that term) in 5.5.1, with reference to
5.1.2.

An adjustable array is an explicit-shape dummy array whose bound
expressions are not initialization expressions.  In f77, this was
pretty special in that it was the only kind of array that could
have bound expressions that were not constant.

F90/f95/f2k still have the same thing, but the standard no longer
seems to have a term for it.  Nonetheless, the concept is useful
and they certainly are not automatic arrays.  (The definition of
"automatic array" explicitly includes "is not a dummy argument").

An adjustable array is different from an automatic array in that
storage is (probably) not allocated for it on entry to the procedure.
Instead, like other dummy arrays, it just "points" to storage in the
actual argument.  My "probably" is because you might get allocation in
copy-in/copy-out scenarios, in which case an adjustable array does
seem a lot like an automatic one...but the standard still doesn't call
it that.  Perhaps in restrospect, the allowance for copy-in/copy-out
might make for enough similarities that it might make sense for the
standard to include adjustable arrays under the "automatic"
definition; I haven't checked to see whether this excessively messes
anything up.

--
Richard Maine                |  Good judgment comes from experience;
[log in to unmask]       |  experience comes from bad judgment.
                             |        -- Mark Twain