fork download
  1. (defun myfn (l)
  2. (loop for n below (length l)
  3. append (make-list #| of length |# (nth (mod (1- n) (length l)) l)
  4. :initial-element (nth n l))))
  5.  
  6. (print (myfn '(2 4 1 3)))
Success #stdin #stdout 0.01s 25192KB
stdin
Standard input is empty
stdout
(2 2 2 4 4 1 1 1 1 3)