1

The CTM book says, "A dictionary is a mapping from simple constants (atoms, names, or integers) to partial values."

As expected, when we execute this code:

declare
Memo = {NewDictionary}
try {Dictionary.put Memo 3        1} catch E then skip end
try {Dictionary.put Memo 5.5      2} catch E then skip end
try {Dictionary.put Memo foo      3} catch E then skip end
try {Dictionary.put Memo foo(bar) 4} catch E then skip end
try {Dictionary.put Memo baz#qux  5} catch E then skip end
{Browse {Dictionary.entries Memo}}

we get [3#1 foo#3].

Are there any common workarounds for using the other types as keys? At the moment, I need to store some data in a sparse matrix, for which, a dictionary ought to have been good enough. But it would be nice to have a general-purpose workaround.

prash
  • 324
  • 3
  • 14

0 Answers0