[CM] rotation-pattern

Rick Taube taube at uiuc.edu
Tue Sep 30 11:32:09 PDT 2003


 >is it possible to get the following with a rotation-pattern?

offhand i dont think so -- it looks like what yhou want is some sort of 
"double" rotation, ie your pattern is as if the default rotation 
happened twice per periond instead of once.
You could do it easily enough as a funcall pattern:

(define (double-shift l)
   (new funcall :of
        #'(lambda ()
            (let ((val l))
              (set! l (append (cddr l)
                              (list (first l)
                                    (second l))))
              val))))

(define x (double-shift '(a b c d e)))

(next x 25)

(A B C D E
  C D E A B
  E A B C D
  B C D E A
  D E A B C)




More information about the Cmdist mailing list