Mapslices failing on n x 0 matrices

question

#1

Is this supposed to happen? I tried mapslices(x->x*2, rand(3,0), 1) and it errors. mapslices(x->x*2, rand(3,1), 1) works as expected.

map(x->x*2, rand(0)) works, so I would assume mapslices should work on empty matrices.


#2

Note that rand(0) is an empty Vector, not a Matrix.

Also, since mapslices determines the resulting dimension from the result of function calls, what should it return when there are no slices?


#3

Okay yeah I guess that makes sense.