Handbook
Glossary
leaf-node
Vocabulary
persistent
.
hashtables
.
nodes
Definition
USING:
math
;
IN:
persistent.hashtables.nodes
TUPLE:
leaf-node
{
value
read-only
}
{
key
read-only
}
{
hashcode
fixnum
read-only
initial:
0
}
;
Methods
USING:
kernel
persistent.hashtables.nodes
persistent.hashtables.nodes.leaf
;
M:
leaf-node
(entry-at)
[
matching-key?
]
1guard
;
USING:
accessors
arrays
kernel
persistent.hashtables.nodes
;
M::
leaf-node
(new-at)
( shift value key hashcode leaf-node -- node' added-leaf )
hashcode leaf-node
hashcode>>
eq?
[
key leaf-node
key>>
=
[
value leaf-node
value>>
=
[
leaf-node
f
]
[
value key hashcode
<leaf-node>
f
]
if
]
[
value key hashcode
<leaf-node>
:>
new-leaf hashcode leaf-node new-leaf
2array
<collision-node>
new-leaf
]
if
]
[
shift leaf-node value key hashcode
make-bitmap-node
]
if
;
USING:
kernel
persistent.hashtables.nodes
persistent.hashtables.nodes.leaf
;
M:
leaf-node
(pluck-at)
[
matching-key?
not
]
1guard
;
USING:
accessors
arrays
kernel
make
persistent.hashtables.nodes
;
M:
leaf-node
>alist%
[
key>>
]
[
value>>
]
bi
2array
,
;