# My wishlist for the next version of Julia

**URL:** <https://discourse.julialang.org/t/my-wishlist-for-the-next-version-of-julia/69987>\
**Category:** General Usage\
**Tags:** question, matlab\
**Created:** [October 18, 2021, 4:28pm UTC](https://discourse.julialang.org/t/my-wishlist-for-the-next-version-of-julia/69987 "2021-10-18T16:28:46Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Post date:** [October 18, 2021, 4:41pm UTC](https://discourse.julialang.org/t/my-wishlist-for-the-next-version-of-julia/69987/2 "2021-10-18T16:41:13Z")

</div>

> [@leon](#):
>
> Creating a m x n sized NaN should be as simple as NaN(m, n). Right now, I have to do this:  
> `A = fill!(Array{Float64}(undef, m, n), NaN);`

```julia
julia> fill(NaN,(3,4))

3×4 Matrix{Float64}:
 NaN NaN NaN NaN
 NaN NaN NaN NaN
 NaN NaN NaN NaN

```

> [@leon](#):
>
> If I have two 1-column data with the same size, A and B, I should be able to get an Index by `Ind = A>3 && B<15` . Right now, I would have to use `map` function to broadcast first:

You are lucky, that will be possible in V1.7 already:

```julia
julia> A = rand(3,4); B = rand(3,4);

julia> inds = A .> 0.5 .&& B .> 0.5
3×4 BitMatrix:
 0 0 0 0
 0 1 1 0
 0 0 1 1

```

Currently you can already do this:

```julia
julia> A = rand(3,4); B = rand(3,4);

julia> (A .> 0.5) .& (B .> 0.5)
3×4 BitMatrix:
 0 0 0 0
 0 1 1 1
 0 0 1 0

```

(and I don’t see any immediate harm in that, with the parenthesis, maybe someone can correct me)

> [@leon](#):
>
> I should be able to initialize an array as `A=[]` , and then append to it as simple as `A = [A; b];` Right now, Julia will complain that I can not append a 0 sized array with a m x n sized array.

If you are just pushing to `A` for the first time, just do `A = b`.

> [@leon](#):
>
> Automatically handle the conversion between vector and array for Index values, instead of relying on users to decide when to use `A` and when to use `vec(A)` .

The difference between vectors and matrices is a feature, actually, and the old julia and matlab users have discussed many times the advantages of that here.

> [@leon](#):
>
> Function should allow us to define the outcome of the function like: `function [A, B] = f1(x, y, z)` , instead of requiring us to use `return` function at the end of the function to return the results.

that can be done:

```julia
julia> f(x) = 2
f (generic function with 1 method)

julia> f(1)
2

```

(but you need to learn the syntax first).

> [@leon](#):
>
> I should be able to use a `sortrows` function, by `B = sortrows(A, Index).` Instead of having to find the Index using `sortperm` first.

I’m not sure what you want to do here, but isn’t this just this? (edit: or more likely, one of the options here: [Sort matrix based on the elements of a specific column - #5 by nicolas](https://discourse.julialang.org/t/sort-matrix-based-on-the-elements-of-a-specific-column/23475/5) - a function that sorts the matrix as a function of one row may exist, I’m not sure)

```julia
julia> A = rand(3,4);

julia> sort(A, dims=2)
3×4 Matrix{Float64}:
 0.0518517 0.055554 0.248347 0.992392
 0.168324 0.318615 0.857768 0.864286
 0.0809794 0.541194 0.724404 0.911751

```

---

_[View the full topic](https://discourse.julialang.org/t/my-wishlist-for-the-next-version-of-julia/69987)._
