]>
The SparseTable domain provides a general purpose table type with default entries.
Here we create a table to save strings under integer keys. The value "Try again!" is returned if no other value has been stored for a key.
Entries can be stored in the table.
These values can be retrieved as usual, but if a look up fails the default entry will be returned.
To see which values are explicitly stored, the keyskeysSparseTable and entriesentriesSparseTable functions can be used.
If a specific table representation is required, the GeneralSparseTable constructor should be used. The domain SparseTable(K, E, dflt) is equivalent to GeneralSparseTable(K,E,Table(K,E), dflt). For more information, see TableXmpPage and GeneralSparseTableXmpPage .