Next Previous Contents

13. _stk_roll

Synopsis

Roll items on the stack

Usage

_stk_roll (Integer_Type n);

Description

This function may be used to alter the arrangement of objects on the stack. Specifically, if the integer n is positive, the top n items on the stack are rotated up. If n is negative, the top abs(n) items on the stack are rotated down.

Example

If the stack looks like:

    item-0
    item-1
    item-2
    item-3
where item-0 is at the top of the stack, then _stk_roll(-3) will change the stack to:
    item-2
    item-0
    item-1
    item-3
Notes

This function only has an effect for abs(n) > 1.

See Also

_stkdepth, _stk_reverse, _pop_n, _print_stack


Next Previous Contents