Odd behaviour of operators on a range?

See the first two lines:
image

Intuitively I would have expected it to return 1001:1010 for the plus and 1000:1000:10000 for the multiplication, that is with the range collected before the operation and eventually reimplemented as range…

I am sure this is documented somewhere, just find it pretty odd…

.+ and .* bind tighter than :, so the first two are equivalent to (1000 .+ 1):10 and (1000 .* 1):10 respectively. This behavior is certainly expected and unlikely to change.

2 Likes