routine rotate

Documentation for routine rotate assembled from the following types:

class List

From List

(List) routine rotate

Defined as:

multi sub    rotate(@list,  Int:D $n = 1 --> List:D)
multi method rotate(List:D: Int:D $n = 1 --> List:D)

Returns the list rotated by $n elements.

Examples:

<a b c d e>.rotate(2);   # <c d e a b> 
<a b c d e>.rotate(-1);  # <e a b c d>