rotate

right-rotate collection by given distance


Parameters

rotate collection :string :literal :block
       distance :integer

Attributes

leftleft rotation

Returns

  • :string
  • :block
  • or  :nothing

Examples

copy
rotate [a b c d e] 1 ; => [e a b c d] rotate.left [a b c d e] 1 ; => [b c d e a] rotate 1..6 4 ; => [3 4 5 6 1 2]

Related