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
Is the following intended or a bug?
I was surprised, because changing 1:4 to : changed the output type. I expected to see the same vector of vectors in both cases.
all arguments are scalars (: is just a generic function and Ref(:) doesn't make a difference) so it expands to
getindex(v, :, :)
i.e. v[:, :].
The key observation is that : only can be interpreted as "all indices" within the context of the getindex function. The broadcast machinery is fully generic and doesn't try to guess how some specific function like getindex will interpret its arguments.
Is the following intended or a bug?
I was surprised, because changing
1:4
to:
changed the output type. I expected to see the same vector of vectors in both cases.The text was updated successfully, but these errors were encountered: