Handbook
Glossary
heap-pop-while ( heap quot: ( key -- ? ) -- values )
Utility words used by CFG optimization
Prev:
heap-members ( heap -- seq )
Next:
slurp/replenish-deque ( ... deque quot: ( ... obj -- ... seq ) -- ... )
Vocabulary
compiler
.
cfg
.
utilities
Inputs
heap
an
object
quot
a
quotation
with stack effect
( key -- ? )
Outputs
values
an
object
Definition
USING:
heaps
kernel
sequences
;
IN:
compiler.cfg.utilities
:
heap-pop-while
( heap quot: ( key -- ? ) -- values )
[
[
dup
heap-peek
]
]
dip
compose
[
[
dup
heap-empty?
[
f
f
]
]
]
dip
[
if
]
curry
compose
[
over
heap-pop*
]
produce
2nip
;
inline