Open generic function
Returns functions used to implement the iteration protocol for tables.
table-protocol table => test-function hash-function
<table>.
<function>.
<function>.
dylan
dylan
Returns the functions used to iterate over tables. These functions are in turn used to implement the other collection operations on <table>.
The test-function argument is for the table test function, which is used to compare table keys. It returns true if, according to the table's equivalence predicate, the keys are members of the same equivalence class. Its signature must be:
test-function key1 key2 => boolean
The hash-function argument is for the table hash function, which computes the hash code of a key. Its signature must be:
hash-function key initial-state => id result-state
In this signature, initial-state is an instance of <hash-state>. The hash function computes the hash code of key, using the hash function that is associated with the table's equivalence predicate. The hash code is returned as two values: an integer id and a hash-state result-state. This result-state is obtained by merging the initial-state with the hash-state that results from hashing key. The result-state may or may not be == to initial-state. The initial-state could be modified by this operation.