2OVER

( x1 x2 x3 x4 -- x1 x2 x3 x4 x1 x2 )

Copy cell pair x1 x2 to the top of the stack.

Testing:

T{ 1 2 3 4 2OVER -> 1 2 3 4 1 2 }T

ContributeContributions

NieDzejkobavatar of NieDzejkob Suggested reference implementationSuggested reference implementation2018-01-06 18:13:14

: 2OVER 2>R 2DUP 2R> 2SWAP ;

JimPetersonavatar of JimPeterson

Another suggested implementation:

: 2OVER 3 PICK 3 PICK ;

(might be faster)

Reply New Version