The DUPN function duplicates the top N elements of the stack after having consumed N which is on the top of the stack when calling DUPN.

As the DUP function, DUPN duplicates the references of the N elements on the top of the stack, it doesn’t copy the elements. If you apply DUPN to a GTS you will have two references to the same GTS object on the stack.

If you want to make a deep copy of a GTS, i.e. if you want copy the content and not only the reference, you can use the CLONE function.

DUPN is available since version 1.0.0.

See also



'foo' 'bar' 2 DUPN