Handbook
Glossary
new-key@ ( key hash -- array n )
Vocabulary
hashtables
.
private
Inputs
key
a key
hash
a
hashtable
Outputs
array
the underlying array of the hashtable
n
the index where the key would be stored
Word description
Searches the hashtable for the key using a quadratic probing strategy. If the key is not present in the hashtable, outputs the index where it should be stored.
See also
key@
Definition
USING:
accessors
kernel
;
IN:
hashtables.private
:
new-key@
( key hash -- array n )
[
array>>
2dup
hash@
0
f
(new-key@)
]
[
over
[
hash-deleted-
]
[
hash-count+
]
if
or*
]
[
2drop
]
1if
;
inline