Closed aury6623 closed 4 weeks ago
I'm coming around to @aury6623 's proposal here. I think we should go ahead and include extensible
while we're at it. I think I've worked out exactly what is needed for all this, so I'll have something submitted later today.
Addressed by #131
There are inconsistencies with the usage of "deferred type"/\<deferred-type> and "deferred class"/\<deferred-class>
In the third of those 3 snippets, we assume that "deferred type" and "deferred class" are mutually exclusive categories. However, in the first snippet, as well as the section headers in the document, we refer to both things together as "deferred type". We also say "can appear in a \<type-spec>" in the first snippet, which is not true of deferred class. We also group them in the BNF, such as "\<deferred-type-declaration-stmt>" which is either TYPE, DEFERRED or CLASS, DEFERRED. We need to be more precise with the terms here.
In the existing standard, "class" is not a term used to describe a type, and it's not really even a word used to describe a data object. I think the closest it gets to that is the "CLASS IS" syntax in a \<type-guard-stmt>. CLASS is only a type specifier which declares polymorphic data objects. I think our problem might be the use of the word "class" at all to describe the concept we want; when I see CLASS in Fortran, I think "declaration of an object", not "definition of a type".
The
TYPE, DEFERRED :: type-name
declaration is supposed to be analogous to theTYPE :: type-name
construct, right? So I think it would be more clear to useTYPE, ABSTRACT, DEFERRED :: type-name
as the declaration, analogous toTYPE, ABSTRACT :: type-name
.With that notion, this PR is my proposal to address the inconsistencies between \<deferred-type> and \<deferred-class>.
If the
TYPE, ABSTRACT, DEFERRED :: type-name
syntax is not preferred, we could still revert back to theCLASS, DEFERRED :: type-name
syntax and keep everything else in this edit the same, except the normative text would change to: