Handbook
Glossary
heap-push* ( value key heap -- entry )
Factor handbook
»
The language
»
Collections
»
Heaps
Prev:
heap-push ( value key heap -- )
Next:
heap-push-all ( assoc heap -- )
Vocabulary
heaps
Inputs
value
an
object
key
a comparable object
heap
a
heap
Outputs
entry
an
entry
Word description
Push a pair onto a heap, and output an entry which may later be passed to
heap-delete
.
Side effects
Modifies
heap
Definition
IN:
heaps
GENERIC:
heap-push*
( value key heap -- entry )
Methods
USING:
accessors
heaps
heaps.private
kernel
;
M:
heap
heap-push*
[
<entry>
dup
]
[
data>>
data-push
]
[
0
rot
sift-down
]
tri
;