William Clodius's idea to disambiguate generic procedures using the
characteristics of dummy arguments has merit. I don't see anything
intrinsically wrong with the recursive definition.
Here's my cut at defining how arguments are different:
1. Non-procedure dummy arguments are different if
(a) their types are different and neither type is a descendant type
of the type of the other, or
(b) their types have a different kind parameter, or
(c) they have different rank.
2. A dummy procedure is different from an argument that is not a dummy
procedure.
3. Dummy procedures that have specified result types are different if
(a) their result types are different and neither type is a descendant
type of the type of other, or
(b) their result types have a different kind parameter, or
(c) their results have different rank.
4. A dummy procedure that is declared by EXTERNAL and for which no result
type is specified is indistinguishable from any other dummy procedure.
5. A dummy procedure that has a specified result type is different from
a dummy procedure that has an explicit interface and is a subroutine.
6. Dummy procedures that have explicit interface are different if their
interfaces specify characteristics that are different according to
these rules.
I don't see a way to do this during the present standardization. None of
the present work items depend sufficiently strongly on this to justify
including it in one of them, and it is unlikely it will be added as an
independent work item, or replace an existing work item, even if somebody
advocates doing so at WG5 meetings.
We should try to get rid of EXTERNAL, but there are legitimate places
where the interface of a dummy procedure is ambiguous -- for example, in
a "driver" procedure that calls one of several procedures that implement
different methods, and have dummy procedures with different interfaces.
Dummy procedure interfaces could be ambiguous, but no more than necessary,
if dummy procedures were allowed to have sets of explicit interfaces, with
the caveat that the only use for a dummy procedure having more than one
interface in its set is as an actual argument that corresponds to a dummy
procedure that has an interface that is a subset of its interfaces.
If dummy procedure interface sets were allowed, one would need to change
rule 6 to be
6. Dummy procedures that have explicit interface are different if every
member of their interface sets specifies characteristics that are
different according to these rules.
This is even less likely to occur during the present standardization, but
if it ever becomes standardized, subsets could eliminate EXTERNAL. Rule 4
could then be eliminated, and rule 5 would become
5. A dummy function procedure is different from a dummy subroutine
procedure.
Best regards,
Van Snyder
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|