(j3.2006) Curious inconsistency

Van Snyder Van.Snyder
Mon Oct 1 20:53:09 EDT 2012


One cannot write

  interface
    procedure P
  end interface
  procedure P

because that declares P twice in the same scoping unit (and violates
C1204).

If P is external or a dummy procedure, with an explicit interface
identified by the name Q, and a generic name G is desired to reference
it, one is required to write

  interface G
    procedure P
  end interface
  procedure(Q) :: P

or copy the interface body for P into every generic interface block
where one needs it.

In the next revision, it would be helpful to change the syntax rule for
<interface-specification> to

R1202 <interface-specification> <<is>> <interface-body
                                <<or>> <procedure-stmt>
                                <<or>> <procedure-declaration-stmt>

(or change the definition of <procedure-stmt>).

It would thereby allow

  interface G
    procedure(Q) :: P
  end interface

and also

  interface G
    procedure(Q), pointer :: P
  end interface

and

  interface G
    procedure(Q), pointer :: P => S
  end interface

which seem to be harmless, and potentially useful.





More information about the J3 mailing list