Handbook
Glossary
insertion-unsort ( str extended -- deltas )
Vocabulary
punycode
.
private
Inputs
str
an
object
extended
an
object
Outputs
deltas
an
object
Definition
USING:
kernel
math
sequences
;
IN:
punycode.private
::
insertion-unsort
( str extended -- deltas )
V{
}
clone
:>
accum
N
:>
oldch! -1
:>
oldi! extended
[|
ch |
-1
:>
i! -1
:>
pos! str
[
ch
<
]
count
:>
curlen curlen 1
+
ch oldch
-
*
:>
delta!
[
str ch i pos
find-pos
pos! i! i -1
=
[
f
]
[
i oldi
-
delta
+
delta! delta 1
-
accum
push
i oldi! 0 delta!
t
]
if
]
loop
ch oldch!
]
each
accum
;