9.18 EqTable¶

The EqTable domain provides tables where the keys are compared using eq?eq?EqTable. Keys are considered equal only if they are the same instance of a structure. This is useful if the keys are themselves updatable structures. Otherwise, all operations are the same as for type Table. See TableXmpPage for general information about tables.

The operation tabletableEqTable is here used to create a table where the keys are lists of integers.

e: EqTable(List Integer, Integer) := table()


 table()

Type: EqTable(List Integer,Integer)

These two lists are equal according to =, but not according to eq?eq?List.

l1 := [1,2,3]


 [1,2,3]

Type: List PositiveInteger

l2 := [1,2,3]


 [1,2,3]

Type: List PositiveInteger

Because the two lists are not eq?eq?List, separate values can be stored under each.

e.l1 := 111


 111

Type: PositiveInteger

e.l2 := 222


 222

Type: PositiveInteger

e.l1


 111

Type: PositiveInteger