Handbook
Glossary
rotate ( seq n -- seq' )
Vocabulary
sequences
.
extras
Inputs
seq
a
sequence
n
an
integer
Outputs
seq'
a
sequence
Word description
Move the first
n
elements of
seq
to the end.
Definition
USING:
kernel
math
sequences
;
IN:
sequences.extras
:
rotate
( seq n -- seq' )
over
length
mod
dup
0
>=
[
cut
]
[
abs
cut*
]
if
prepend
;