# When Should One Use \`(...)\` or \`\[...\]\` for Array Comprehensions

**URL:** <https://discourse.julialang.org/t/when-should-one-use-or-for-array-comprehensions/60423>\
**Category:** General Usage\
**Tags:** arrays\
**Created:** [May 2, 2021, 3:40pm UTC](https://discourse.julialang.org/t/when-should-one-use-or-for-array-comprehensions/60423 "2021-05-02T15:40:26Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Post date:** [May 3, 2021, 7:11am UTC](https://discourse.julialang.org/t/when-should-one-use-or-for-array-comprehensions/60423/4 "2021-05-03T07:11:11Z")

</div>

This [post](https://discourse.julialang.org/t/are-generator-expressions-documented-also-other-questions/13786/7) provides advanced analysis of the topic.

In the Julia manual, comprehensions written without the enclosing square brackets using [generator expressions](https://docs.julialang.org/en/v1/manual/arrays/#Generator-Expressions) lie in the same [Multi-dimensional Arrays](https://docs.julialang.org/en/v1/manual/arrays/#man-multi-dim-arrays) section as comprehensions written with enclosing square brackets.

---

_[View the full topic](https://discourse.julialang.org/t/when-should-one-use-or-for-array-comprehensions/60423)._
