Handbook
Glossary
pheap>alist ( heap -- alist )
Persistent heaps
Prev:
assoc>pheap ( assoc -- heap )
Next:
pheap>values ( heap -- seq )
Vocabulary
persistent
.
heaps
Inputs
heap
a persistent heap
Outputs
alist
an association list
Word description
Creates an association list whose keys are the entries in the heap and whose values are the associated priorities. It is in sorted order by priority. This does not modify the heap.
Definition
USING:
arrays
kernel
sequences
;
IN:
persistent.heaps
:
pheap>alist
( heap -- alist )
[
dup
pheap-empty?
not
]
[
pheap-pop
2array
]
produce
nip
;