# Question:Invalid left hand side in assignment - issue with Vector size?

## Question:Invalid left hand side in assignment - issue with Vector size?

Maple 2022

I was trying to assign a Vector to a Vector inside a procedure. However, when the Vector has a size of 5, I was able to do that. But not when the Vector has a size of 7.

I have the following example. I can't assign the Vector over when the Vector has a size of 7 as shown in `oneStep_egcd2`.  But I can do that when the size is 5 in `oneStep_egcd`. Copying the contents over using a for loop works as expected.

 >
 > a:= 17; b:= 5;
 (1)

 > # prev := <1, a, 0, b, a>;
 (2)
 > curr := <0, a, 1, b, b>;
 (3)
 > oneStep_egcd := proc(prev::Vector, curr::Vector)     local q, t1, t2, t3;     if (curr[5] <> 0) then         q := iquo(prev[5], curr[5]);         t1, t2, t3 := prev[1] - curr[1] * q, prev[3] - curr[3] * q, prev[5] - curr[5] * q;         prev = curr;         curr[1], curr[3], curr[5] := t1, t2, t3;     end if: end proc:
 > oneStep_egcd(prev, curr)
 (4)

 > # prev := <1, 1, a, 0, 0, b, a>;
 (5)
 > curr := <0, 0, a, 1, 1, b, b>;
 (6)
 > oneStep_egcd2 := proc(prev::Vector, curr::Vector)     local q, sb_q, t1, t2, t4, t5, t7;     if (curr[7] <> 0) then         q := iquo(prev[7], curr[7]);         sb_q := (q);         t1 := prev[1] - curr[1] * q;         t2 := prev[2] - curr[2] * q;         t4 := prev[4] - curr[4] * q;         t5 := prev[5] - curr[5] * q;         t7 := prev[7] - curr[7] * q;         prev := curr;         curr[1], curr[2], curr[4], curr[5], curr[7] := t1, t2, t4, t5, t7;     end if: end proc:
 > oneStep_egcd2(prev, curr)

 > oneStep_egcd3 := proc(prev::Vector, curr::Vector)     local q, sb_q, t1, t2, t4, t5, t7, i;     if (curr[7] <> 0) then         q := iquo(prev[7], curr[7]);         sb_q := (q);         t1 := prev[1] - curr[1] * q;         t2 := prev[2] - curr[2] * q;         t4 := prev[4] - curr[4] * q;         t5 := prev[5] - curr[5] * q;         t7 := prev[7] - curr[7] * q;         for i to 7 do             prev[i] := curr[i];         end do;         curr[1], curr[2], curr[4], curr[5], curr[7] := t1, t2, t4, t5, t7;     end if: end proc:
 > oneStep_egcd3(prev, curr)
 (7)