You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To create a 0-d array with arr0, we can actually pass an array literal as follows
let a = arr0([0]);
This is ignored because arr0 does not check what is passed or whether it has the correct shape. First of all, I think this is bad. See the related issue: #1253
As you can see, I don't need to pass a reference.
Now, if we attempt to create a 1d, 2d or 3d array with the similar functions, we need to pass the literal by reference, i.e. the following does not compile
let a = arr1([[0], [2]]);
The same happens with arr2 and arr3.
Whether we decide to solve the other issue #1253 or not, in my view, this inconsistency should not exist.
By the way, we can also do
let a = arr0(&[0]);
This inconsistency is due to the fact that arr0 accepts A while the other functions accept &[A], and I suppose we can pass references when we accept A
The text was updated successfully, but these errors were encountered:
0-d is always a special case, so I don't see what the action should be here. A 0-d array is very similar to a scalar, so I think its argument should be a scalar.
To create a 0-d array with
arr0
, we can actually pass an array literal as followsThis is ignored because
arr0
does not check what is passed or whether it has the correct shape. First of all, I think this is bad. See the related issue: #1253As you can see, I don't need to pass a reference.
Now, if we attempt to create a 1d, 2d or 3d array with the similar functions, we need to pass the literal by reference, i.e. the following does not compile
The same happens with
arr2
andarr3
.Whether we decide to solve the other issue #1253 or not, in my view, this inconsistency should not exist.
By the way, we can also do
This inconsistency is due to the fact that
arr0
acceptsA
while the other functions accept&[A]
, and I suppose we can pass references when we acceptA
The text was updated successfully, but these errors were encountered: