fork(1) download
  1. ; list rotations
  2.  
  3. (define (rots xs)
  4. (define (rot1 xs)
  5. (append (cdr xs) (list (car xs))))
  6. (do ((n (length xs) (- n 1))
  7. (zs (list xs) (cons (rot1 (car zs)) zs)))
  8. ((= n 1) zs)))
  9.  
  10. (display (rots '(a b c d e)))
Success #stdin #stdout 0s 7964KB
stdin
Standard input is empty
stdout
((e a b c d) (d e a b c) (c d e a b) (b c d e a) (a b c d e))