Re: What is this
- From: kargl@xxxxxxxxxxxxxxxxxxxxxxxxxxxx (Steven G. Kargl)
- Date: Fri, 29 Feb 2008 22:54:33 +0000 (UTC)
In article <1id2s8t.1bbglp8e5vewoN%nospam@xxxxxxxxxxxxx>,
nospam@xxxxxxxxxxxxx (Richard Maine) writes:
FX <coudert@xxxxxxxxxxxxx> wrote:
"C1263 (R1238) The function-name and each dummy-arg-name shall be
specified, explicitly or implicitly, to be scalar."
Hmm. So I see, and I agree with your analysis. Now I'm trying to
reconstruct where the material that I recall was from. Not having a lot
of luck with that. I looked at earlier versions of the standard; that
restriction also appears in f90 and f95. F77 doesn't have a simillarly
phrased restriction, but a careful reading of f77 translates to the same
thing. (In particular, the dummy argument is only allowed to have the
same name as a variable.... and in f77 an array does not count as a
variable).
Aha. I think I'm getting closer. look at the wording in 16.3 of f2003
(and similar words in f95 and f90). Those sound like the words I recall
debates about. In particular, they talk about having the same type and
type parameters as an entity of the same in the host would have, but
having no other attributes (DIMENSION being an attribute). Those are the
words that I think were interpreted to mean that the host could have an
array of that name (as long as the array was integer). I swear I recall
an example like that in some interp. But it might possibly have been an
example of some other construct entity such as a forall index or an
ac-implied-DO variable. I don't think those have a constraint like the
one you found for statement function dummy arguments.
I have to say that constraint doesn't seem to fit well with the material
in 16.3. From 16.3, it doesn't appear as though there is any way to
declare anything about the dummy argument except for its type (which
must be integer) and its type parameter. So that seems to make the
constraint nonsense, as you say. Sounds like an internal contradition in
the standard to me. Interp time?
It's not complete nonsense.
program z
real :: h(5), x(5) = 1.
real y
f(y) = y * x ! Invalid because f is implicitly an array via x.
h = f(2.)
end program z
Of course, F77 did not have array syntax. My immediate thoughts on
the constraint on dummy arguments is reference to array sections.
program z
real :: h(3), x(5) = 1.
f(x(2:4)) = 2 * x ! Invalid dummy arg (not to mention downright ugly).
h = f(x)
end program z
I suspect J3 in the F90 days was trying to avoid code like the above.
--
Steve
.
- Follow-Ups:
- Re: What is this
- From: FX
- Re: What is this
- From: Richard Maine
- Re: What is this
- References:
- Re: What is this
- From: Richard Maine
- Re: What is this
- Prev by Date: Re: What is this
- Next by Date: Re: What is this
- Previous by thread: Re: What is this
- Next by thread: Re: What is this
- Index(es):
Relevant Pages
|