Handbook
Glossary
remove-left ( heap -- value prio newheap )
Vocabulary
persistent
.
heaps
.
private
Inputs
heap
an
object
Outputs
value
an
object
prio
an
object
newheap
an
object
Definition
USING:
accessors
kernel
persistent.heaps
;
IN:
persistent.heaps.private
:
remove-left
( heap -- value prio newheap )
[
[
left>>
]
[
right>>
]
bi
[
pheap-empty?
]
both?
]
1check
[
[
value>>
]
[
prio>>
]
bi
<persistent-heap>
]
[
>branch<
swap
remove-left
-rot
[
<branch>
]
2dip
rot
]
if
;