Arc Forumnew | comments | leaders | submitlogin
1 point by offby1 6094 days ago | link | parent

For what it's worth, mzscheme's "hash-table-get" solves this by giving you an optional "default" value -- if you omit the value, then you get an exception; if you specify the value, then you just get that value -- unless the value is a procedure, in which case it calls that procedure. The procedure can raise your favorite exception, or perhaps _insert_ something into the hash table, or ... anything you want. This seems like a nice balance between simplicity and flexibility.