Modern Fortran Explained: Incorporating Fortran 2018 lists in A.2 storage association, including
sequence attribute, statement, and type as deprecated features.
The Authors define a deprecated feature as a feature that became redundant (for
sequence, specifically, since Fortran 95) and whose use is not recommended. They say that deprecated feature have potential to be marked as obsolescent by the Standard, which in turn, opens a path toward deletion.
The Standard, however, doesn’t say anything about deprecated features, only obsolescent and deleted features. The
sequence attribute, statement, type are defined as usual, without note of them becoming obsolescent in the future, as far as I could find.
So, what does it really mean for Metcalf, Reid, & Cohen to list deprecated features? Are these their personal recommendations that are not necessarily aligned with the Standard?
I think we answer this question in Section A.1.
Indeed, the relevant sentence is:
We note that his decision to group certain features into an appendix and to deprecate their use is ours alone, and does not have the actual or implied approval of either WG5 or J3.
Time to recalibrate my selective reading.
With this question resolved, the follow-up would be: What is the alternative for
sequence if it should be avoided?
I don’t find a language feature that makes
sequence redundant, only
bind(c) comes close, but it is not the same.
If you read the relevant section, it is evident that the entire concept of storage association is deprecated. There will be no need for SEQUENCE attribute if COMMON and EQUIVALENCE are not used. At least that’s how I understand it.
sequence not for the purpose of explicit memory management, but for its property to make a derived type non-extendible. I’m not aware of a modifier other than
bind(c) which can add this property to a derived type, but with
sequence I can still have
allocatable members in the type.
There is a paper seen by J3 for a SEALED attribute, titled “Option to derive an inextensible type”, considered “out-of-order features”.
@FortranFan has mentioned this proposal on at least two occasions:
As I understand A.2, it deprecates
sequence in the context of storage association, and it does not consider that it can also be used to prohibit extending a type (a use that I didn’t think of before stdlib/#320).
sealed is the way to go, but in the meantime I think it’s okay to use
sequence as a hack as long as it’s documented.
Correct, but that prohibition is stated on page 293.
I guess another use/meaning of
sequence attribute in derived types was to make two identical definitions of the type (in different scopes) same type. This is obviously made redundant by putting the definition into a module.