comp |
Syntax |
comp(E:LIST, RECORD, STRING, or VECTOR, X_1:INT,...,X_k:INT):OBJECT |
Description |
Example |
/**/ 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 |