Handbook
Glossary
(entry-at) ( key hashcode node -- entry )
Vocabulary
persistent
.
hashtables
.
nodes
Inputs
key
an
object
hashcode
an
object
node
an
object
Outputs
entry
an
object
Definition
IN:
persistent.hashtables.nodes
GENERIC:
(entry-at)
( key hashcode node -- entry )
Methods
USING:
accessors
kernel
math
persistent.hashtables.nodes
persistent.hashtables.nodes.bitmap
sequences.private
;
M::
bitmap-node
(entry-at)
( key hashcode bitmap-node -- entry )
bitmap-node
shift>>
:>
shift hashcode shift
bitpos
:>
bit bitmap-node
bitmap>>
:>
bitmap bitmap-node
nodes>>
:>
nodes bitmap bit
bitand
0
eq?
[
f
]
[
key hashcode bit bitmap
index
nodes
nth-unsafe
(entry-at)
]
if
;
USING:
kernel
persistent.hashtables.nodes
persistent.hashtables.nodes.collision
;
M::
collision-node
(entry-at)
( key hashcode collision-node -- entry )
key hashcode collision-node
find-index
nip
;
USING:
kernel
persistent.hashtables.nodes
;
M:
empty-node
(entry-at)
3drop
f
;
USING:
accessors
persistent.hashtables.nodes
sequences.private
;
M::
full-node
(entry-at)
( key hashcode full-node -- entry )
key hashcode hashcode full-node
shift>>
mask
full-node
nodes>>
nth-unsafe
(entry-at)
;
USING:
kernel
persistent.hashtables.nodes
persistent.hashtables.nodes.leaf
;
M:
leaf-node
(entry-at)
[
matching-key?
]
1guard
;