racket - Rotate a List of Lists -
i want take arbitrary list of lists , "rotate" it. is, list of lists of size 3x3: #lang racket (require rackunit) (define (rotate-lol lol) (append (list (map first lol)) (list (map second lol)) (list (map third lol)))) (check-equal? (rotate-lol (list (list 'a 'b 'c) (list 'd 'e 'f) (list 'g 'h 'i))) (list (list 'a 'd 'g) (list 'b 'e 'h) (list 'c 'f 'i))) i'm thinking list-ref replace first / second / third can't quite figure out concise way this. i know there has got elegant way this. i've done inelegant solutions problem in past more domain specific, i'd solve general case, stash in personal library, , done problem. tips or solutions? it's pretty zip , don't have make since it's in srfi-1 list library : (require srfi/1) (zip '(a b c) ...