Next Previous Contents

28. dup

Synopsis

Duplicate the value at the top of the stack

Usage

dup ()

Description

This function returns an exact duplicate of the object on top of the stack. For some objects such as arrays or structures, it creates a new reference to the array. However, for simple scalar S-Lang types such as strings, integers, and doubles, it creates a new copy of the object.

See Also

pop, typeof


Next Previous Contents