| NEST HelpDesk | Command Index | NEST Quick Reference |
| Name: | roll - Roll a portion n stack levels k times | ||
| Synopsis: | objn ... obj1 n k roll | ||
| Description: | roll performs a circular shift of the first n stack levels by k positions. Before this is done, roll removes its arguments from the stack. If k is positive, each shift consists of moving the contents of level 0 to level n-1, thereby moving elements at levels 1 through n-1 up one stack level. If k is negative, each shift consists of moving the contents of level n-1 to level 0, thereby moving elements at levels 1 through n-1 down one stack level. | ||
| Examples: |
(a) (b) (c) 3 1 roll -> (c) (a) (b)
(a) (b) (c) 3 -1 roll -> (b) (c) (a)
(a) (b) (c) 3 0 roll -> (a) (b) (c)
| ||
| Diagnostics: | Raises StackUnderflow error if there are less than n+2 objects on the stack. | ||
| Source: | /home/abuild/rpmbuild/BUILD/nest-2.4.1/sli/slistack.cc |
| NEST HelpDesk | Command Index | NEST Quick Reference |
© 2000-2010 The NEST Initiative