==== DUP2 ====
----
----
Duplicate the objects on level 1 and level 2 of the stack
----
^ __Input Stack__ ^^ ^ __Output Stack__ ^^^^
| **O2** | **O1** | **→** | **O2** | **O1** | **O2** | **O1** |
| //Level 2// | //Level 1// | //→// | //Level 4// | //Level 3// | //Level 2// | //Level 1// |
{{page>manual:chapter6:aux:legend&nofooter&noeditbtn&inline}}
|**Type**| [[manual:chapter5:basics#commands|Command]] ||
|**Parallel list processing**| [[manual:chapter5:listproc#group-2commands-that-must-use-dolist-to-parallel-process|Group 2]] ||
|**Affected by flags**| None ||
----
The ''DUP2'' command creates a duplicate of the objects on the first two levels of the stack.
----
This command is fully compatible with userRPL.
----
3: "This is a string"
2: { 'X' 'Y' 'Z' }
1: 1_m
……………………………………………………………………………………
DUP2
will result in
5: "This is a string"
4: { 'X' 'Y' 'Z' }
3: { 'X' 'Y' 'Z' }
2: 1_m
1: 1_m
……………………………………………………………………………………
----
{{page>manual:chapter6:stack&nofooter&noeditbtn&inline}}