Phillip Helbig writes:
> Internal procedures cannot be used as actual arguments (e.g. Fortran 95
> Handbook, Sect. 12.1.1.14).
>
> Can someone (re)state the rationale behind this?
I wasn't there at the time, but I have talked to some people who were.
So my data is second hand. As usual, rationale is sometimes a little
tricky to pin down, as people aren't required to state a rationale
with their votes (and even if they were so required, one couldn't
necessarily tell whether the stated rationale was the *REAL* one).
But, given those caveats, the rationale explained to me goes something
like....
There are extra complications to passing internal procedures,
particularly when combined with recursion. If you pass an internal
procedure of a recursive procedure, then there may be multiple
"instantiations" of the procedure, and you need to be sure that
you end up having the internal procedure inherit variables from
the correct instantiation of its host one. Each instantiation has a
separate copy of unsaved local variables.
It is believed (by the people who explained this to me) that the
means for handling this are reasonably well known, both in terms of
how to define it in the standard and in terms of how to implement
that definition. But it is extra complication. F90 added quite a
lot of extra complication already, which was a source of major
controversy. This particular feature had very little active support,
so it was something that was easy to delete in the name of
simplification.
Before you reply, yes, I'm aware that other approaches could have been
taken. For example, it could have been disallowed to pass internal
procedures of recursive hosts - that would have probably avoided most
of the problems, at the expense of making the rule a little more
complicated. I am not trying to defend the decision as the only
possible, or even the best, choice. I am just trying to pass along
the rationale as explained to me.
I was there when f2k requirements were being discussed. One of the
proposals was to relax this restriction. In my recollection, it
failed simply for lack of adequate support. Nobody thought it a
particularly bad idea, as far as I recall (though my recollection
could be faulty). It just didn't have a constituency pushing for the
feature. There were a small handful of people arguing that it would
be good for consistency and showing textbook-like examples of where it
would be useful. But this just wasn't supported by enough
demonstrated customer demand. For example, I don't think any vendors
had reports of customers griping about the lack of such a feature. So
the feature didn't get enough support to "make the cut".
--
Richard Maine
[log in to unmask]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|