Handbook
Glossary
gnome-sort ( seq -- sorted-seq )
Vocabulary
rosetta-code
.
gnome-sort
Inputs
seq
an
object
Outputs
sorted-seq
an
object
Definition
USING:
kernel
math
sequences
;
IN:
rosetta-code.gnome-sort
:
gnome-sort
( seq -- sorted-seq )
1
swap
[
2dup
length
<
]
[
2dup
[
need-swap?
]
[
swap-back
dec-pos
]
while
2drop
inc-pos
]
while
nip
;