I thought about specifying the default when the table was created, but it seemed more flexible to do it at lookup, because you could choose a value for the default (e.g. a newly created object) that would let you distinguish between having no entry for some key and having an entry whose value was the default.
seems to be the code for looking up a key using the (some-table key) syntax (i.e. putting the table as the "function" in a form). Would it work to have an optional parameter, so that somebody could call (some-table key default) if they wanted to override the default? I'm thinking that this optional parameter would default to #f if unspecified, and would be passed to the first hash-table-get in the above code. This seems to enable overriding of a pre-specified default.
Yeah, I can tell it's Scheme because of #f used for false, instead of NIL.
If it's possible to pass an optional parameter to an Arc-style hash-table lookup (one where you use the table name as the function), than that would also allow overriding a default to NIL, because the 'or in that Scheme code would return NIL rather than evaluating the hash-table-get for the original default.