[GAP Forum] Lists in GAP
Neha Gupta
neha.gupta2008 at googlemail.com
Wed Jul 1 12:25:26 BST 2009
Dear Forum Member,
I want to use arrays in GAP. But Im not able to find a way of
declaring/defining one. The following is what I intend to do...
I have defined elems1 as a List with 36 members. A tyical element of elems1
looks like this :
Tuple([ C2[1],Random(M)])
Now I wish to define another List elems2 also with 36 members using elems1 :
b:=Random([1..16]);;
x:=elems1[b][2];;
pik:=Random(M);;
for j in [1..36] do
if (j<> b) then
elems2[j]:=elems1[j];;
else
elems2[j]:=Tuple([elems1[j][1],pik]);;
fi;
od;
I get the following error :
" Error, The list you are trying to assign to is immutable called from
j <> b called from
<function>( <arguments> ) called from read-eval-loop "
Please help me defining a List/Array.
Neha
More information about the Forum
mailing list