C10 - initial
|Type||Corrade progressive sift|
permute sift will rotate the elements of the list left or right a number of times depending on the provided parameter.
| ||an integer||the number and direction of rotations||
You can imagine the CSV list returned by Corrade to the
data parameter as an indexed array of items. Positive integers represent rotations to the right and negative rotations represent rotations to the left. A rotation (or permutation) in terms of the
permute sift means a shift of all elements in the array such that for a left rotation and for a right rotation where is the index of an arbitrary item of the array and is the absolute value of the integer.
permute sift wraps the CSV list around such that when the first element will become the last element and the second element will become the first element in the CSV list. Conversely, for a right-rotation , the last element becomes the first element and the first element becomes the second element.
The following sift, when added to a command, will delete the first two items of the CSV list and then rotate the resulting list twice to the left.
"sift", wasListToCSV([ "skip", 2, "permute", "-2" ]),
Given the input:
then the following transformations will occur:
and the expected output will be: