mnswap ( m n -- quot )
Factor handbook > The language > Combinators > Generalized shuffle words and combinators > Generalized shuffle words

Prev:ndrop ( n -- )
Next:nweave ( n -- quot )


Vocabulary
generalizations

Inputs and outputs
man integer
nan integer


Word description
Swaps the top m stack elements with the n elements directly underneath.

Examples
Some core words expressed in terms of mnswap:
swap1 1 mnswap
rot2 1 mnswap
-rot1 2 mnswap


Definition