What is the status of the sequence attribute and statement?

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?

CC @m_b_metcalf

I think we answer this question in Section A.1.


Mike Metcalf

1 Like

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. :sweat_smile:

1 Like

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.

I’m using 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”.


1 Like

@FortranFan has mentioned this proposal on at least two occasions:

1 Like

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.

1 Like

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.

1 Like