# One-sided ranges in array indexes

**URL:** <https://discourse.julialang.org/t/one-sided-ranges-in-array-indexes/45336>\
**Category:** Internals & Design\
**Tags:** indexing, array\
**Created:** [August 21, 2020, 8:27pm UTC](https://discourse.julialang.org/t/one-sided-ranges-in-array-indexes/45336 "2020-08-21T20:27:29Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [August 22, 2020, 5:42am UTC](https://discourse.julialang.org/t/one-sided-ranges-in-array-indexes/45336/10 "2020-08-22T05:42:27Z")

</div>

> [@derikk](#):
>
> However, `a[:3] ` is interpreted as `a[3]` . While this is valid code, I don’t believe that anyone would intentionally write this expecting to get `a[3]` .
> 
> Would it be possible to integrate this syntax into Julia without breaking any existing code or adding too much parse logic?

Note that the `a[:x]` syntax would have to work not only for literals like `3`, but general expressions, as it does currently. There you would run into breaking changes as `:` currently quotes the expression. Cf

> [@PSA: Julia is not at that stage of development anymore](https://discourse.julialang.org/t/psa-julia-is-not-at-that-stage-of-development-anymore/44872/):
>
> You heard about this brand new exciting programming language called Julia and have some suggestions for how it should work. Wonderful! We’re happy to have you here and help you learn the language and listen to your ideas! However, please be aware that “new” is a relative term. Yes, Julia is newer than, say, C, which was first created in 1972 and standardized in 1989. It is not, however, new in the sense that it is still being freely designed and changed in arbitrary ways. Julia development start…

---

_[View the full topic](https://discourse.julialang.org/t/one-sided-ranges-in-array-indexes/45336)._
