OFFSET
0,3
LINKS
A. Karttunen, Gatomorphisms (Includes the complete Scheme source for computing this sequence)
PROG
(Scheme function implementing this automorphism on list-structures:)
(define (car_robr_cdr! s) (cond ((not (pair? s))) ((not (pair? (car s))) (swap! s)) (else (car_robr_cdr! (car s)) (robr! s) (car_robr_cdr! (cdr s)))) s)
(define (robr! s) (let ((ex-cdr (cdr s))) (set-cdr! s (caar s)) (set-car! (car s) ex-cdr) (swap! (car s)) (swap! s) s))
(define (swap! s) (let ((ex-car (car s))) (set-car! s (cdr s)) (set-cdr! s ex-car) s))
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, May 30 2002
STATUS
approved