Example Consider the following print function. Now consider the problem of defining a function called ones that returns a multi-dimensional array with all the elements set to 1. This function dumps out what is currently on the S-lang . It does not alter the stack and it is usually used for debugging purposes. Specifically, if the integer n is positive, the top n items on the stack are rotated up.
Usage Get the number of objects currently on the stack.
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. The exch swaps the two top items on the stack. The pop function removes the top item from the stack.