Returns the test-function and hash-function for the <table>. These functions are in turn used to implement the other collection operations on <table>.
The method for <object-table> returns == as the test-function and object-hash as the hash-function.
The method for <object-table> could be written as
define method table-protocol (table :: <object-table>)
=> test-function :: <function>,
hash-function :: <function>;
values(\==, object-hash);
end method table-protocol;
open
| table | An instance of <table>. |
| test-function | An instance of <function>. Its signature is test-function( key1, key2 ) ⇒ boolean. |
| test-function is used to compare keys. It returns true if the keys are members of the same equivalence class according to the table’s equivalence predicate. | |
| hash-function | An instance of <function>. Its signature is hash-function( key, initial-state ) ⇒ ( id, result-state ) |
| hash-function computes the hash code of the key, using the hash function associated with the table’s equivalence predicate. The hash code is returned as two values, id (an integer) and state (a hash state). |