# Array comprehension is inconsistent, given the column-major property of julia

**URL:** <https://discourse.julialang.org/t/array-comprehension-is-inconsistent-given-the-column-major-property-of-julia/134946>\
**Category:** Internals & Design\
**Tags:** question, array\
**Created:** [January 8, 2026, 4:29am UTC](https://discourse.julialang.org/t/array-comprehension-is-inconsistent-given-the-column-major-property-of-julia/134946 "2026-01-08T04:29:45Z")\
**Posts on this page:** 1\
**Showing post:** 11

<div class="post-metadata">

**Author:** ![eldee](https://avatars.discourse-cdn.com/v4/letter/e/b5a626/32.png) [@eldee](https://discourse.julialang.org/u/eldee)\
**Post date:** [January 8, 2026, 1:02pm UTC](https://discourse.julialang.org/t/array-comprehension-is-inconsistent-given-the-column-major-property-of-julia/134946/11 "2026-01-08T13:02:53Z")

</div>

By the way, this topic is essentially a duplicate of

> [@\`for i = 1:M, j = 1:N\` discrepancy (loop vs comprehension/generator)](https://discourse.julialang.org/t/for-i-1-m-j-1-n-discrepancy-loop-vs-comprehension-generator/75659):
>
> I noticed the following about the for i = 1:M, j = 1:N syntax. When using this syntax as part of a normal for-loop, j iterates first: julia\> for i = 1:2, j = 1:3 println((i, j)) end (1, 1) (1, 2) (1, 3) (2, 1) (2, 2) (2, 3) But in a comprehension/generator i iterates first: julia\> [println((i, j)) for i = 1:2, j = 1:3] (1, 1) (2, 1) (1, 2) (2, 2) (1, 3) (2, 3) I get that for i = 1:M, j = 1:N ... end is shorthand for for i = 1:M for j = 1:N ... end end, but it’s a bit confusing …

In particular, check out `okatsn`’s summary at the end.

---

_[View the full topic](https://discourse.julialang.org/t/array-comprehension-is-inconsistent-given-the-column-major-property-of-julia/134946)._
