|
4.10.1 list declarations
- Syntax:
list name = expression_list;
list name = list_expression;
- Purpose:
- defines a list (of objects of possibly different types).
- Default:
- empty list
- Example:
| list l=1,"str";
l[1];
==> 1
l[2];
==> str
ring r;
listvar(r);
==> // r [0] *ring
ideal i = x^2, y^2 + z^3;
l[3] = i;
l;
==> [1]:
==> 1
==> [2]:
==> str
==> [3]:
==> _[1]=x2
==> _[2]=z3+y2
listvar(r); // the list l belongs now to the ring r
==> // r [0] *ring
==> // l [0] list, size: 3
==> // i [0] ideal, 2 generator(s)
|
|