Handbook
Glossary
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 of the key
?
a boolean indicating whether the key was present
Word description
Searches the hashtable for the key using a quadratic probing strategy. Searches stop if either the key or an
+empty+
sentinel is found. Searches skip the
+tombstone+
sentinel.
See also
new-key@
Definition
USING:
accessors
kernel
;
IN:
hashtables.private
:
key@
( key hash -- array n ? )
array>>
dup
length>>
0
eq?
[
no-key
]
[
2dup
hash@
0
(key@)
]
if
;
inline