On Friday, December 9, 2022 at 6:22:08 AM UTC-5, Steve Lionel wrote:
> On 12/8/2022 2:10 PM, Peter Klausler US wrote:
> > If T is some type, what are the semantic differences between
> >
> >> procedure(T) :: entity
> >
> > and
> >
> >> type(T), external :: entity
> >
> > , if any?
> These are similar - both declare "entity" to be a function with implicit
> interface and a function result of type(T). The difference is that the
> latter gives entity the EXTERNAL attribute, while the former does not.
> See F2018 15.4.3.6p3.
@Steve Lionel:
Re: your comment, "The difference is that the latter gives entity the EXTERNAL attribute, while the former does not. See F2018 15.4.3.6p3."
- it is likely inaccurate what you wrote re: the EXTERNAL attribute with "while the former does not."
Note 15.4.3.6 p1, page 298 has, "A procedure declaration statement declares procedure pointers, dummy procedures, and external procedures. It specifies the EXTERNAL attribute (8.5.9) for all entities in the proc-decl-list."
Also, the section you quoted i.e., 15.4.3.6p3 only addresses the `declaration-type-spec` aspect, it does not mention the EXTERNAL attribute because it does not need to, "If proc-interface appears and consists of declaration-type-spec, it specifies that the declared procedure entities are functions having implicit interfaces and the specified result type. If a type is specified for an external function, its function definition (15.6.2.2) shall specify the same result type and type parameters."