# What happened to Base.colon?

**URL:** <https://discourse.julialang.org/t/what-happened-to-base-colon/16513>\
**Category:** General Usage\
**Created:** [October 19, 2018, 12:48am UTC](https://discourse.julialang.org/t/what-happened-to-base-colon/16513 "2018-10-19T00:48:51Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Qiyamah](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/qiyamah/32/2660_2.png) [@Qiyamah](https://discourse.julialang.org/u/Qiyamah)\
**Post date:** [October 19, 2018, 12:48am UTC](https://discourse.julialang.org/t/what-happened-to-base-colon/16513/1 "2018-10-19T00:48:51Z")

</div>

It was working with 0.6 ?

---

<div class="post-metadata">

**Author:** ![tim.holy](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tim.holy/32/52_2.png) [@tim.holy](https://discourse.julialang.org/u/tim.holy)\
**Post date:** [October 19, 2018, 12:54am UTC](https://discourse.julialang.org/t/what-happened-to-base-colon/16513/2 "2018-10-19T00:54:40Z")

</div>

Use julia-0.7 when you have questions like this, it will tell you the answer itself:

````julia
julia> Base.colon(3, 5)
WARNING: Base.colon is deprecated, use : instead.                                                                                                                                                                                            
 in module Base                                                                                                                                                                                                                              
3:5                                                                                                                                                                                                                                          
                                                                                                                                                                                                                                             
julia> :(3, 5)
:((3, 5)) ```
````

---

<div class="post-metadata">

**Author:** ![Sukera](https://avatars.discourse-cdn.com/v4/letter/s/ce7236/32.png) [@Sukera](https://discourse.julialang.org/u/Sukera)\
**Post date:** [October 19, 2018, 7:25am UTC](https://discourse.julialang.org/t/what-happened-to-base-colon/16513/3 "2018-10-19T07:25:56Z")

</div>

I don’t think using `:(3, 5)` is equivalent - seems like that defines an expression returning the tuple `(3,5)` instead of a range object. `3:5` should be what you’re looking for instead.

---

<div class="post-metadata">

**Author:** ![Liso](https://avatars.discourse-cdn.com/v4/letter/l/898d66/32.png) [@Liso](https://discourse.julialang.org/u/Liso)\
**Post date:** [October 19, 2018, 8:21am UTC](https://discourse.julialang.org/t/what-happened-to-base-colon/16513/4 "2018-10-19T08:21:53Z")

</div>

> [@tim.holy](#):
>
> Use julia-0.7 when you have questions like this, it will tell you the answer itself

Publishing 0.7 (nearly) parallel to 1.0 was ~~ugly~~ hack which ignore meaning of deprecation **period** (period is about time, right?).

Telling somebody (who we don’t know) to use 0.7 when trying some code (for example from blog) **could** be felt as strange behavior.

* * *

PS. I was trying to checkout 0.7 and grep `@deprecate` macro to find list of deprecations which could help to answer similar questions. Unfortunately it is not easy.

Maybe it would be better to collect deprecations in toml (or json something similar) files in the future? It could be used by code-generator, News.md generator, help-generator, linters etc.

---

<div class="post-metadata">

**Author:** ![tim.holy](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tim.holy/32/52_2.png) [@tim.holy](https://discourse.julialang.org/u/tim.holy)\
**Post date:** [October 19, 2018, 8:28am UTC](https://discourse.julialang.org/t/what-happened-to-base-colon/16513/5 "2018-10-19T08:28:49Z")

</div>

Sorry, of course you’re right, that’s always been expression syntax—so the depwarn is a little confusing. You just need parens, `(:)(3,5)`.

And if the OP was about overriding it, then it’s:

```julia
julia> import Base: :

julia> nothing:nothing
ERROR: MethodError: no method matching -(::Nothing, ::Nothing)
Stacktrace:
 [1] (::Colon)(::Nothing, ::Nothing) at ./range.jl:7
 [2] top-level scope at none:0

julia> (:)(::Nothing, ::Nothing) = "hello"
(::Colon) (generic function with 14 methods)

julia> nothing:nothing
"hello"

```

> Telling somebody (who we don’t know) to use 0.7 when trying some code (for example from blog) **could** be felt as strange behavior.

I don’t understand this at all. The point of 0.7 was to help people change their code, but not everyone got the message. If someone comes to you with a problem, how does providing them with the _systematic_ way to figure things out on their own constitute a problem? What, exactly, are you proposing as an alternative?

---

<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:** [October 19, 2018, 8:46am UTC](https://discourse.julialang.org/t/what-happened-to-base-colon/16513/6 "2018-10-19T08:46:37Z")

</div>

> [@Liso](#):
>
> PS. I was trying to checkout 0.7 and grep `@deprecate` macro to find list of deprecations which could help to answer similar questions. Unfortunately it is not easy.

They are written up for every release in the [NEWS.md](https://github.com/JuliaLang/julia/blob/v0.7.0/NEWS.md). You can just search that for `deprecate`.

---

<div class="post-metadata">

**Author:** ![DNF](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dnf/32/10191_2.png) [@DNF](https://discourse.julialang.org/u/DNF)\
**Post date:** [October 19, 2018, 10:30am UTC](https://discourse.julialang.org/t/what-happened-to-base-colon/16513/7 "2018-10-19T10:30:44Z")

</div>

> [@Liso](#):
>
> Publishing 0.7 (nearly) parallel to 1.0 was ~~ugly~~ hack which ignore meaning of deprecation **period** (period is about time, right?).

This is an argument that you can make, ok.

> [@Liso](#):
>
> Telling somebody (who we don’t know) to use 0.7 when trying some code (for example from blog) **could** be felt as strange behavior.

_This_ makes _no_ sense at all.

---

<div class="post-metadata">

**Author:** ![foobar\_lv2](https://avatars.discourse-cdn.com/v4/letter/f/ee59a6/32.png) [@foobar\_lv2](https://discourse.julialang.org/u/foobar_lv2)\
**Post date:** [October 19, 2018, 12:00pm UTC](https://discourse.julialang.org/t/what-happened-to-base-colon/16513/8 "2018-10-19T12:00:48Z")

</div>

> Publishing 0.7 (nearly) parallel to 1.0 was ~~ugly~~ hack which ignore meaning of deprecation **period** (period is about time, right?).

Publishing 0.7 nearly parallel to 1.0 was _amazing_. This is the best kind of deprecation I have ever seen. The deprecation **period** is from publication of 0.7 until there is some critical 1.0.x or 1.x bugfix or feature you need that fails to get backported to 0.7.

My main minor gripe is the naming of versions, because obviously a lot of people did not get the memo (this question pops up a lot). Also, a lot of new people started on 1.0 before the ecosystem transitioned (you get the publicity for “1.0” only once).

Second, linux distribution support is lacking; for example archlinux used to ship `0.6` only, and now ships `1.0` only. I’d have prefered a similar story to python, where it is clear that different versions are completely different languages and you get all relevant versions you want to install to cooperate (there want to be `julia10` and `julia06` and `julia07` binaries and a symlink `/usr/bin/julia` to whatever version I want as default). `pacman -Syu` breaking my code was not nice. I don’t know how other distributions (julia pro? conda? debian? cygwin?) deal with that. I don’t know whether `julialang` influenced that or provides guidance for distribution, but that could have been handled better (and yes, sure, building it myself and placing symlinks works, but this defies the point of having a distro at all).

---

<div class="post-metadata">

**Author:** ![Liso](https://avatars.discourse-cdn.com/v4/letter/l/898d66/32.png) [@Liso](https://discourse.julialang.org/u/Liso)\
**Post date:** [October 24, 2018, 8:31am UTC](https://discourse.julialang.org/t/what-happened-to-base-colon/16513/9 "2018-10-24T08:31:54Z")

</div>

> [@foobar\_lv2](#):
>
> Second, linux distribution support is lacking; for example archlinux used to ship `0.6` only, and now ships `1.0` only. I’d have prefered a similar story to python …

There was intention not to copy python’s path here. 🙂

And Arch is doing it right in standard way.

---

<div class="post-metadata">

**Author:** ![Liso](https://avatars.discourse-cdn.com/v4/letter/l/898d66/32.png) [@Liso](https://discourse.julialang.org/u/Liso)\
**Post date:** [October 24, 2018, 8:40am UTC](https://discourse.julialang.org/t/what-happened-to-base-colon/16513/10 "2018-10-24T08:40:12Z")

</div>

> [@tim.holy](#):
>
> What, exactly, are you proposing as an alternative?

First of all I would change wording. Instead of `Use julia-0.7 when you have questions like this` it would rather say something like `it could be useful to use julia-0.7 when you have **more** questions like this`.

We could also tell people that useful info they could find in History.md on github.

But if you really want (\*) that people have test it in 0.7 **maybe** we could bundle both version into current install binaries. (or add choice to install both in single step)

(\*) - BTW I think it is not a good idea…

---

<div class="post-metadata">

**Author:** ![carstenbauer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/carstenbauer/32/4981_2.png) [@carstenbauer](https://discourse.julialang.org/u/carstenbauer)\
**Post date:** [October 24, 2018, 8:57am UTC](https://discourse.julialang.org/t/what-happened-to-base-colon/16513/11 "2018-10-24T08:57:52Z")

</div>

Although I agree that many people seem to have missed the v0.7 memo, I think it is important to realize that v0.7 is really only relevant for people who have already used Julia before v0.7, that is in a phase where it was common knowledge that new Julia versions will certainly break things.

Those people aren’t _new Julia users_. I think it’s ok to treat them like rather established Julia users and just point them to the relevant information without too many words. I don’t think that’s rude in any way but rather efficient.

---

<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:** [October 24, 2018, 9:33am UTC](https://discourse.julialang.org/t/what-happened-to-base-colon/16513/12 "2018-10-24T09:33:33Z")

</div>

> [@Liso](#):
>
> We could also tell people that useful info they could find in History.md on github.

I don’t really see the point of telling people that they can read more about a project’s history in (surprise!) `HISTORY.md`.

All these things are obvious/standard, or can be found with negligible effort. Simply restating them leads to infinite regress: from then on, you have to think about the possibility of people not finding the meta-documentation where you pointed them to the documentation.

I think it would be best for future discussion about similar topics if people who had a hard time finding some information despite making a reasonable effort came forward and talked about their experience. This would allow us to improve the documentation where needed.

---

<div class="post-metadata">

**Author:** ![foobar\_lv2](https://avatars.discourse-cdn.com/v4/letter/f/ee59a6/32.png) [@foobar\_lv2](https://discourse.julialang.org/u/foobar_lv2)\
**Post date:** [October 24, 2018, 9:44am UTC](https://discourse.julialang.org/t/what-happened-to-base-colon/16513/13 "2018-10-24T09:44:18Z")

</div>

> [@Tamas\_Papp](#):
>
> I don’t really see the point of telling people that they can read more about a project’s history in (surprise!) `HISTORY.md` .

Sometimes Captain Obvious is helpful, and RTFM Section x.y can be the reply people need.

But the julia 0.7 hint, `HISTORY.md` hint and the “global scope loops” hint should probably all go into the “think about code formatting” default box on discourse.

---

<div class="post-metadata">

**Author:** ![Liso](https://avatars.discourse-cdn.com/v4/letter/l/898d66/32.png) [@Liso](https://discourse.julialang.org/u/Liso)\
**Post date:** [October 24, 2018, 9:51am UTC](https://discourse.julialang.org/t/what-happened-to-base-colon/16513/14 "2018-10-24T09:51:27Z")

</div>

> [@Tamas\_Papp](#):
>
> I don’t really see the point of telling people that they can read more about a project’s history in (surprise!) `HISTORY.md` .

If people ask similar question do you think that they read that file? (I don’t)

---

<div class="post-metadata">

**Author:** ![Liso](https://avatars.discourse-cdn.com/v4/letter/l/898d66/32.png) [@Liso](https://discourse.julialang.org/u/Liso)\
**Post date:** [October 24, 2018, 10:08am UTC](https://discourse.julialang.org/t/what-happened-to-base-colon/16513/15 "2018-10-24T10:08:04Z")

</div>

> [@carstenbauer](#):
>
> Although I agree that many people seem to have missed the v0.7 memo, I think it is important to realize that v0.7 is really only relevant for people who have already used Julia before v0.7, that is in a phase where it was common knowledge that new Julia versions will certainly break things.
> 
> Those people aren’t _new Julia users_ .

There are people who starts to learn language by trying examples. And you really could find some in older version.

For example [chess board](https://discourse.julialang.org/t/chess-game/16417/29) from @jonathanBieler where newbie has to “fix” `linspace`… (I don’t think that installing 0.7 in that case is best idea)

> [@carstenbauer](#):
>
> … and just point them to the relevant information without too many words. I don’t think that’s rude in any way but rather efficient.

I agree.

---

<div class="post-metadata">

**Author:** ![joa-quim](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/joa-quim/32/227_2.png) [@joa-quim](https://discourse.julialang.org/u/joa-quim)\
**Post date:** [October 24, 2018, 1:23pm UTC](https://discourse.julialang.org/t/what-happened-to-base-colon/16513/16 "2018-10-24T13:23:10Z")

</div>

> [@carstenbauer](#):
>
> I think it is important to realize that v0.7 is really only relevant for people who have already used Julia before v0.7

I only partially agree with this argument that has been raised several times. Other than old users, new users that come from a Matlab background will have (bad) surprises that v0.7 warns about but v1.0 just erros (`linspace` and `repmat` come to my mind but I have crossed with other situations).

---

<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:** [October 24, 2018, 1:28pm UTC](https://discourse.julialang.org/t/what-happened-to-base-colon/16513/17 "2018-10-24T13:28:48Z")

</div>

> [@joa-quim](#):
>
> new users that come from a Matlab background will have (bad) surprises that v0.7 warns about

AFAIK there was no explicit intent to warn Matlab users specifically. This is just accidental and covers a subset of Matlab idioms that were used in Julia initially. Matlab users should benefit from the [writeup of differences](https://docs.julialang.org/en/stable/manual/noteworthy-differences/#Noteworthy-differences-from-MATLAB-1).

---

<div class="post-metadata">

**Author:** ![carstenbauer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/carstenbauer/32/4981_2.png) [@carstenbauer](https://discourse.julialang.org/u/carstenbauer)\
**Post date:** [October 24, 2018, 1:33pm UTC](https://discourse.julialang.org/t/what-happened-to-base-colon/16513/18 "2018-10-24T13:33:03Z")

</div>

@Tamas_Papp is right. Python also doesn’t warn you in a nice way about either of those functions. Different languages have different function names and syntax.

It’s more the group of MATLAB users that used Julia before v0.7 and saw “oh all my functions are there” who is now complaining about the straight errors.

---

<div class="post-metadata">

**Author:** ![joa-quim](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/joa-quim/32/227_2.png) [@joa-quim](https://discourse.julialang.org/u/joa-quim)\
**Post date:** [October 24, 2018, 1:36pm UTC](https://discourse.julialang.org/t/what-happened-to-base-colon/16513/19 "2018-10-24T13:36:23Z")

</div>

Mind you that I’m talking about things that have worked for \> 5/6 of the language age (quite a bit more than _initially_).

---

<div class="post-metadata">

**Author:** ![DNF](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dnf/32/10191_2.png) [@DNF](https://discourse.julialang.org/u/DNF)\
**Post date:** [October 24, 2018, 1:53pm UTC](https://discourse.julialang.org/t/what-happened-to-base-colon/16513/20 "2018-10-24T13:53:03Z")

</div>

> [@carstenbauer](#):
>
> Python also doesn’t warn you in a nice way about either of those functions. Different languages have different function names and syntax.

But they were never part of Python. They _were_ part of Julia, and new users get confused when they try to run example code found online.

There might not exist a quick fix, and it will fix itself in time. Or maybe there just needs to be some clearer instructions on the Downloads page. Right now there is, in fact, some text explaining when using v0.7 might be useful. Perhaps that text should just be moved up and highlighted.

[Next page](https://discourse.julialang.org/t/what-happened-to-base-colon/16513.md?page=2)
