[GAP Forum] Help please

Abdulsatar Al-Juburie a.j.t.al-juburie at newcastle.ac.uk
Mon Aug 12 20:50:12 BST 2013


Dear All,


In the following small code when  I try to print  Y , I found that  Y  is changed , but I did change just on Y1.  Is there any way to print  Y 

Without any change.



f:=function(L)
local i,j,Y,Y1;

Y:=L;
Y1:=L;

Y1[1][1]:=90;
Y1[2][1]:=90;

Print(" ","\n");
Print("\ Y =",Y);
Print(" ","\n");

Print("\ Y1=",Y1);
Print(" ","\n");
end;

The input to the function is:

f([ [ 0, 21, 31, 41 ], [ 1, 0, 21, 31 ], [ 0, 0, 0, 21 ], [ 0, 0, 0, 0 ] ]);


Result of print is:

 Y =[ [ 90, 21, 31, 41 ], [ 90, 0, 21, 31 ], [ 0, 0, 0, 21 ], [ 0, 0, 0, 0 ] ]

 Y1=[ [ 90, 21, 31, 41 ], [ 90, 0, 21, 31 ], [ 0, 0, 0, 21 ], [ 0, 0, 0, 0 ] ]


Any idea and/or help are more than appreciated


Regards,


Abdulsatar




More information about the Forum mailing list