Clamps Dictionary
rotate
Function
(rotate seq &optional (n 1))
Rotate seq by num elems (to the right). num can be negative. If num is larger than the list size it will wrap around as if the rotation was called recursively num times.
Arguments
seq |
Proper sequence to rotate. |
num |
Integer number of rotations. |
Examples
(rotate '(dog bird lion cat horse) 1) ; => (horse dog bird lion cat) (rotate #(dog bird lion cat horse) -1) ; => (bird lion cat horse dog) (rotate '(dog bird lion cat horse) 4733) ; => (lion cat horse dog bird)
Created: 2025-06-08 So 16:56