# What is the status of the sequence attribute and statement?

**URL:** <https://fortran-lang.discourse.group/t/what-is-the-status-of-the-sequence-attribute-and-statement/720>\
**Category:** Help\
**Created:** [February 15, 2021, 4:29pm UTC](https://fortran-lang.discourse.group/t/what-is-the-status-of-the-sequence-attribute-and-statement/720 "2021-02-15T16:29:36Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![milancurcic](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/milancurcic/32/2_2.png) [@milancurcic](https://fortran-lang.discourse.group/u/milancurcic)\
**Post date:** [February 15, 2021, 4:29pm UTC](https://fortran-lang.discourse.group/t/what-is-the-status-of-the-sequence-attribute-and-statement/720/1 "2021-02-15T16:29:36Z")

</div>

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](https://j3-fortran.org/doc/year/18/18-007r1.pdf), 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

---

<div class="post-metadata">

**Author:** ![m\_b\_metcalf](https://avatars.discourse-cdn.com/v4/letter/m/858c86/32.png) [@m\_b\_metcalf](https://fortran-lang.discourse.group/u/m_b_metcalf)\
**Post date:** [February 15, 2021, 4:58pm UTC](https://fortran-lang.discourse.group/t/what-is-the-status-of-the-sequence-attribute-and-statement/720/2 "2021-02-15T16:58:01Z")

</div>

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

Regards,

Mike Metcalf

---

<div class="post-metadata">

**Author:** ![milancurcic](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/milancurcic/32/2_2.png) [@milancurcic](https://fortran-lang.discourse.group/u/milancurcic)\
**Post date:** [February 15, 2021, 5:05pm UTC](https://fortran-lang.discourse.group/t/what-is-the-status-of-the-sequence-attribute-and-statement/720/3 "2021-02-15T17:05:30Z")

</div>

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. 😅

---

<div class="post-metadata">

**Author:** ![awvwgk](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/awvwgk/32/154_2.png) [@awvwgk](https://fortran-lang.discourse.group/u/awvwgk)\
**Post date:** [February 15, 2021, 5:19pm UTC](https://fortran-lang.discourse.group/t/what-is-the-status-of-the-sequence-attribute-and-statement/720/4 "2021-02-15T17:19:40Z")

</div>

With this question resolved, the follow-up would be: What is the alternative for `sequence` if it should be avoided?

> [@milancurcic](#):
>
> The Authors define a deprecated feature as a feature that became redundant (for `sequence` , specifically, since Fortran 95) and whose use is not recommended.

I don’t find a language feature that makes `sequence` redundant, only `bind(c)` comes close, but it is not the same.

---

<div class="post-metadata">

**Author:** ![themos](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/themos/32/521_2.png) [@themos](https://fortran-lang.discourse.group/u/themos)\
**Post date:** [February 15, 2021, 8:28pm UTC](https://fortran-lang.discourse.group/t/what-is-the-status-of-the-sequence-attribute-and-statement/720/5 "2021-02-15T20:28:20Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![awvwgk](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/awvwgk/32/154_2.png) [@awvwgk](https://fortran-lang.discourse.group/u/awvwgk)\
**Post date:** [February 15, 2021, 8:35pm UTC](https://fortran-lang.discourse.group/t/what-is-the-status-of-the-sequence-attribute-and-statement/720/6 "2021-02-15T20:35:04Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![themos](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/themos/32/521_2.png) [@themos](https://fortran-lang.discourse.group/u/themos)\
**Post date:** [February 15, 2021, 8:57pm UTC](https://fortran-lang.discourse.group/t/what-is-the-status-of-the-sequence-attribute-and-statement/720/7 "2021-02-15T20:57:36Z")

</div>

There is a paper seen by J3 for a SEALED attribute, titled “Option to derive an inextensible type”, considered “out-of-order features”.

[https://j3-fortran.org/doc/year/19/19-186.txt](https://j3-fortran.org/doc/year/19/19-186.txt)  
[https://j3-fortran.org/doc/year/19/minutes219.txt](https://j3-fortran.org/doc/year/19/minutes219.txt)

---

<div class="post-metadata">

**Author:** ![ivanpribec](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/ivanpribec/32/3290_2.png) [@ivanpribec](https://fortran-lang.discourse.group/u/ivanpribec)\
**Post date:** [February 15, 2021, 9:03pm UTC](https://fortran-lang.discourse.group/t/what-is-the-status-of-the-sequence-attribute-and-statement/720/8 "2021-02-15T21:03:06Z")

</div>

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

- [Programming errors by language - #6 by FortranFan](https://fortran-lang.discourse.group/t/programming-errors-by-language/512/6)
- [High Performance Fortran (HPF) history and lessons - #22 by FortranFan](https://fortran-lang.discourse.group/t/high-performance-fortran-hpf-history-and-lessons/367/22)

---

<div class="post-metadata">

**Author:** ![milancurcic](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/milancurcic/32/2_2.png) [@milancurcic](https://fortran-lang.discourse.group/u/milancurcic)\
**Post date:** [February 15, 2021, 9:18pm UTC](https://fortran-lang.discourse.group/t/what-is-the-status-of-the-sequence-attribute-and-statement/720/9 "2021-02-15T21:18:00Z")

</div>

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](https://github.com/fortran-lang/stdlib/pull/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.

---

<div class="post-metadata">

**Author:** ![m\_b\_metcalf](https://avatars.discourse-cdn.com/v4/letter/m/858c86/32.png) [@m\_b\_metcalf](https://fortran-lang.discourse.group/u/m_b_metcalf)\
**Post date:** [February 16, 2021, 8:02am UTC](https://fortran-lang.discourse.group/t/what-is-the-status-of-the-sequence-attribute-and-statement/720/10 "2021-02-16T08:02:25Z")

</div>

Correct, but that prohibition _is_ stated on page 293.

Regards,

Mike

---

<div class="post-metadata">

**Author:** ![msz59](https://avatars.discourse-cdn.com/v4/letter/m/3d9bf3/32.png) [@msz59](https://fortran-lang.discourse.group/u/msz59)\
**Post date:** [February 16, 2021, 7:05pm UTC](https://fortran-lang.discourse.group/t/what-is-the-status-of-the-sequence-attribute-and-statement/720/11 "2021-02-16T19:05:52Z")

</div>

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.
