Example
Input:
T:=table(3=-10,"a"=10,"b"=20,"c"=30,"d"=40):;
Input:
T["b"]
Output:
Input:
T[3]
Output:
Remark.
Tables can be created and the elements of a table can be changed using
the := assignment.
-
If T is a symbolic variable then the assignment
T(index_name:=element_value
will create a table T with one element.
- If n is an integer, then the assignment
T(n):=obj will do the following:
-
If the variable T was assigned to a list or a sequence,
then the nth element of T is modified.
- if the variable T was not assigned, a table T
is created with one entry (corresponding to the index n). Note
that after the assignment T is not a list, despite the fact that n
is an integer.