# Should \`collect\` also be deprecated, like \`full\`?

**URL:** <https://discourse.julialang.org/t/should-collect-also-be-deprecated-like-full/6888>\
**Category:** Internals & Design\
**Created:** [November 4, 2017, 10:40pm UTC](https://discourse.julialang.org/t/should-collect-also-be-deprecated-like-full/6888 "2017-11-04T22:40:44Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dlfivefifty](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dlfivefifty/32/1959_2.png) [@dlfivefifty](https://discourse.julialang.org/u/dlfivefifty)\
**Post date:** [November 4, 2017, 10:40pm UTC](https://discourse.julialang.org/t/should-collect-also-be-deprecated-like-full/6888/1 "2017-11-04T22:40:45Z")

</div>

I’m very glad to see `full` deprecated: I was never sure what exactly it meant, whereas `Matrix(...)` is unambiguous.

Does the same argument apply to `collect`? For example, I’m surprised the following returns an Array (in 0.6):

```julia
julia> collect(CartesianRange(CartesianIndex((1,1)), CartesianIndex((2,2))))
2×2 Array{CartesianIndex{2},2}:
 CartesianIndex{2}((1, 1)) CartesianIndex{2}((1, 2))
 CartesianIndex{2}((2, 1)) CartesianIndex{2}((2, 2))

```

Insisting on the use of `Array`/`Vector`/`Matrix` instead of `collect` seems more explicit and predictable.

---

<div class="post-metadata">

**Author:** ![fredrikekre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fredrikekre/32/1688_2.png) [@fredrikekre](https://discourse.julialang.org/u/fredrikekre)\
**Post date:** [November 5, 2017, 9:49am UTC](https://discourse.julialang.org/t/should-collect-also-be-deprecated-like-full/6888/2 "2017-11-05T09:49:53Z")

</div>

Yes, there is work in progress towards that. See [https://github.com/JuliaLang/julia/issues/16029](https://github.com/JuliaLang/julia/issues/16029) and recent development of [https://github.com/JuliaLang/julia/issues/11557](https://github.com/JuliaLang/julia/issues/11557)

---

<div class="post-metadata">

**Author:** ![harven](https://avatars.discourse-cdn.com/v4/letter/h/3da27b/32.png) [@harven](https://discourse.julialang.org/u/harven)\
**Post date:** [November 5, 2017, 1:57pm UTC](https://discourse.julialang.org/t/should-collect-also-be-deprecated-like-full/6888/3 "2017-11-05T13:57:28Z")

</div>

FWIW, I often collect in order to sort.

---

<div class="post-metadata">

**Author:** ![dlfivefifty](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dlfivefifty/32/1959_2.png) [@dlfivefifty](https://discourse.julialang.org/u/dlfivefifty)\
**Post date:** [November 6, 2017, 6:32am UTC](https://discourse.julialang.org/t/should-collect-also-be-deprecated-like-full/6888/4 "2017-11-06T06:32:59Z")

</div>

You’d call `sort(Vector(itr))`. That’s actually a good example why `collect` is currently flawed: if it returns a matrix then calling sort will fail.

---

<div class="post-metadata">

**Author:** ![harven](https://avatars.discourse-cdn.com/v4/letter/h/3da27b/32.png) [@harven](https://discourse.julialang.org/u/harven)\
**Post date:** [November 6, 2017, 1:29pm UTC](https://discourse.julialang.org/t/should-collect-also-be-deprecated-like-full/6888/5 "2017-11-06T13:29:01Z")

</div>

Or sort could collect automatically when needed, so we would just have to `sort(itr)`.
