v1 = rand(5);
size(v1) # returns (5,)
size(v1, 1) = 5 # fine
size(v1, 2) = 1 # ?
size(v1, 3) = 1 # ??
...
size(v1,100) = 1 # ? ... ?
I think I would have expected size(v1, k) for k > 1 to be 0, not 1. Is this intended behavior? Perhaps it has the potential to mislead. Is there some other design consideration I’m ignoring? The problem arose for me because I did the following:
l, w = size(v1) # I expected (1,0)
ERROR: BoundsError: attempt to access (5,)
at index [2]