slurp-heap ( ... heap quot: ( ... value key -- ... ) -- ... )
Factor handbook » The language » Collections » Heaps

Prev:heap-delete ( entry heap -- )


Vocabulary
heaps

Inputs
heapa heap
quota quotation with stack effect ( ... value key -- ... )


Outputs
None

Word description
Removes entries from a heap and processes them with the quotation until the heap is empty.

Definition


: slurp-heap
( ... heap quot: ( ... value key -- ... ) -- ... )
[ drop [ heap-empty? ] curry ]
[ [ [ heap-pop ] curry ] dip compose until ] 2bi ; inline