At the moment, hashmap[val] return fail when val is not in hashmap. This is inconsistent with lists, where l[2] returns an error if 2 is not bound in a list l.
My suggested fix:
-
Make hashmap[val] return an Error if val is unbound.
-
Add a new function Lookup(map, key [,default]), which returns map[key] if that is defined, and default otherwise. If default is ommitted, treat it as fail, which gives the behaviour of the current hashmap[val].