(define fun4 (lambda ( ls) (cond ((null? ls ) #f) (cons (((eqv? \'a (car ls))) && ((eqv? \'b (cdr ls))))) (else (pattern2 cdr ls)))))
In
So much wheel reinvention. Just use SRFI 1!
(require srfi/1) (define (fun4 lst) (every eq? lst (circular-list 'a 'b)))
(This operates under the assumption that (a b a) should be valid rather than invalid.)
(a b a)