Handbook
Glossary
collect-pairs ( hash quot: ( key value -- elt ) -- seq )
Vocabulary
hashtables
.
private
Inputs
hash
an
object
quot
a
quotation
with stack effect
( key value -- elt )
Outputs
seq
an
object
Definition
USING:
accessors
arrays
assocs
kernel
math
sequences.private
;
IN:
hashtables.private
:
collect-pairs
( hash quot: ( key value -- elt ) -- seq )
[
[
array>>
0
swap
]
[
assoc-size
f
<array>
]
bi
]
dip
swap
[
[
overd
set-nth-unsafe
1
+
]
curry
compose
each-pair
]
keep
nip
;
inline