Explanation for surprising behavior of array slicing