Understanding `view`

I do find it a bit confusing that passing a scalar argument to view returns a container particularly considering that

@view x[1]

is valid syntax (that returns a container). I imagine there’s a good reason for why it is the way it is, but I’m a bit fuzzy on that at the moment.

3 Likes