Handbook
Glossary
pheap-pop* ( heap -- newheap )
Persistent heaps
Prev:
pheap-pop ( heap -- newheap value prio )
Next:
pheap-empty? ( heap -- ? )
Vocabulary
persistent
.
heaps
Inputs
heap
a persistent heap
Outputs
newheap
a new persistent heap
Word description
Creates a new persistent heap with the minimum element removed.
Definition
USING:
accessors
kernel
persistent.heaps.private
;
IN:
persistent.heaps
:
pheap-pop*
( heap -- newheap )
[
pheap-empty?
]
1check
[
empty-pheap
]
[
[
left>>
pheap-empty?
]
1check
[
drop
<persistent-heap>
]
[
[
left>>
remove-left
]
keep
right>>
swap
sift-down
]
if
]
if
;