Right now the general signature size(A, dims...)
does different things depending on whether there are zero, one or many dimensions provided. It seems like it would be better to separate this into: no dimension argument, scalar dimension argument, and tuple dimension argument.
Ah, so you'd want to still support size(A, 1)
returning a single integer? Yes, that seems quite reasonable to me.
Note that the axes
function doesn't support either varargs or tuples — it's either all or one. The two should probably match.
Yes, the proposal would be that these three forms are supported:
size(A)
--> (sizes[1], sizes[2], ...)
size(A, d)
--> sizes[d]
size(A, (dims...))
--> (sizes[dims[1]], sizes[dims[2]], ...)
Or we could just deprecate it entirely...
Supporting a tuple argument would be a bigger change. Many size
methods don't constrain the dimension argument at all, and I think that's just fine.
This was only used within tests of size
itself within the entire testsuite. I think we'll be just fine without it.
Most helpful comment
Ah, so you'd want to still support
size(A, 1)
returning a single integer? Yes, that seems quite reasonable to me.Note that the
axes
function doesn't support either varargs or tuples — it's either all or one. The two should probably match.