built in operators: srotate-left
srotate-left:
description:
srotate-left input-seq
rotate the input sequence left one step
srotate-left[n] input-seq
rotate the input sequence left n steps, modulus size(input-seq)
examples:
srotate-left (|one> . |two> . |three> . |four> . |five>)
|two> . |three> . |four> . |five> . |one>
srotate-left[3] (|one> . |two> . |three> . |four> . |five>)
|four> . |five> . |one> . |two> . |three>
-- 11 mod 5 == 1, so rotate left 1 step:
srotate-left[11] (|one> . |two> . |three> . |four> . |five>)
|two> . |three> . |four> . |five> . |one>
see also:
srotate-right, rotate-right, rotate-left
Home