Handbook
Glossary
(sort-pairs) ( i1 i2 seq quot accum -- )
Vocabulary
sorting
.
private
Inputs
i1
an
object
i2
an
object
seq
an
object
quot
an
object
accum
an
object
Outputs
None
Definition
USING:
growable.private
kernel
math.order
sequences
sequences.private
;
IN:
sorting.private
:
(sort-pairs)
( i1 i2 seq quot accum -- )
[
2dup
length
=
]
2dip
rot
[
[
drop
nip
nth-unsafe
]
dip
push-unsafe
]
[
[
[
[
nth-unsafe
]
curry
bi@
2dup
]
dip
call
+gt+
eq?
[
swap
]
when
]
dip
[
push-unsafe
]
curry
bi@
]
if
;
inline