Itβs easier to understand why, if you present a slice on the left side of the assignment.
>> (b = a.clone)[2,1] = :a; pb [1, 2, :a] >> (b = a.clone)[2,0] = :b; pb [1, 2, :b, 3] >> (b = a.clone)[3,1] = :c; pb [1, 2, 3, :c] >> (b = a.clone)[3,0] = :d; pb [1, 2, 3, :d]
source share