Handbook
Glossary
singleton-sift-down ( value prio singleton empty -- heap )
Vocabulary
persistent
.
heaps
.
private
Inputs
value
an
object
prio
an
object
singleton
an
object
empty
an
object
Outputs
heap
an
object
Definition
USING:
accessors
kernel
math
persistent.heaps
;
IN:
persistent.heaps.private
:
singleton-sift-down
( value prio singleton empty -- heap )
2over
prio>>
<=
[
<branch>
]
[
drop
-rot
[
[
value>>
]
[
prio>>
]
bi
]
2dip
<singleton-heap>
<persistent-heap>
<branch>
]
if
;