# Array comprehensions in Fortran

**URL:** <https://fortran-lang.discourse.group/t/array-comprehensions-in-fortran/2517>\
**Category:** Help\
**Created:** [January 5, 2022, 10:35pm UTC](https://fortran-lang.discourse.group/t/array-comprehensions-in-fortran/2517 "2022-01-05T22:35:08Z")\
**Posts on this page:** 4\
**Page:** 2

<div class="post-metadata">

**Author:** ![certik](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/certik/32/4_2.png) [@certik](https://fortran-lang.discourse.group/u/certik)\
**Post date:** [January 8, 2022, 1:40am UTC](https://fortran-lang.discourse.group/t/array-comprehensions-in-fortran/2517/22 "2022-01-08T01:40:02Z")

</div>

> [@omacl](#):
>
> Again, my original motivation was — I like the simplicity and elegance of one line list comprehensions in other languages (they track math language closely)

I agree and I am missing them too, especially coming from Python. The Fortran syntax for this is not intuitive to me and I have to admit I always have to look up how to actually write it, and it’s still more restrictive. I feel there is definitely room for improvement.

---

<div class="post-metadata">

**Author:** ![omacl](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/omacl/32/1112_2.png) [@omacl](https://fortran-lang.discourse.group/u/omacl)\
**Post date:** [January 10, 2022, 10:09pm UTC](https://fortran-lang.discourse.group/t/array-comprehensions-in-fortran/2517/23 "2022-01-10T22:09:12Z")

</div>

> [@everythingfunctional](#):
>
> I would be in favor of adding the capability to the language. It would essentially be “syntactic sugar” like the following

BTW if I was brave enough to suggest this to the standards committee (??) would I just open an issue here

> **[GitHub - j3-fortran/fortran\_proposals: Proposals for the Fortran Standard...](https://github.com/j3-fortran/fortran_proposals)**
>
> Proposals for the Fortran Standard Committee. Contribute to j3-fortran/fortran\_proposals development by creating an account on GitHub.

?

---

<div class="post-metadata">

**Author:** ![everythingfunctional](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/everythingfunctional/32/176_2.png) [@everythingfunctional](https://fortran-lang.discourse.group/u/everythingfunctional)\
**Post date:** [January 10, 2022, 10:18pm UTC](https://fortran-lang.discourse.group/t/array-comprehensions-in-fortran/2517/24 "2022-01-10T22:18:00Z")

</div>

I would suggest that be your first step. There’s a bit of bureaucracy involved in submitting an actual proposal, but this is where some of us have been tracking community suggestions and occasionally presenting them to the committee to gauge feasibility.

Edit: and by some of us I mean mostly @certik

---

<div class="post-metadata">

**Author:** ![omacl](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/omacl/32/1112_2.png) [@omacl](https://fortran-lang.discourse.group/u/omacl)\
**Post date:** [January 12, 2022, 12:05am UTC](https://fortran-lang.discourse.group/t/array-comprehensions-in-fortran/2517/25 "2022-01-12T00:05:07Z")

</div>

Thanks!

Gave it a go: [Allow array comprehension syntax in implied do loop · Issue #244 · j3-fortran/fortran\_proposals · GitHub](https://github.com/j3-fortran/fortran_proposals/issues/244#issue-1099730132)

[Previous page](https://fortran-lang.discourse.group/t/array-comprehensions-in-fortran/2517.md?page=1)
