Use R ::= QQ[x,y,z];
L := [4,5,[6,7],8];
Comp(L,1);
4
-------------------------------
Comp(L,3);
[6, 7]
-------------------------------
Comp(L,3,2);
7
-------------------------------
Define F(X) Return [X, X^2]; EndDefine;
-- the following usage of "Comp" is useful for programming
F(2);
[2, 4]
-------------------------------
Comp(F(2),2);
4
-------------------------------
Struct := Record[L := [x,y,z], S := "string"];
Struct["L",3]; -- "Comp" works for records also
z
-------------------------------
Comp(Struct,"L",3);
z
-------------------------------
Comp("this is a string",3); -- use of "Comp" with strings
i
-------------------------------
|