I need compare every second element in the list but I don’t know how. Here is an example:
(compare? '(1 x 2 x 3 x 4)) -> #t
(compare? '(1 x 2 x 3 o)) -> #f
I can only compare second and fourth element:
(define compare?
(lambda (list)
(equal? (cadr list) (cadddr list))))
I need 6th, 8th, 10th etc…. I don’t know length of the list. Please, help me.
Try this answer, filling-in the blanks: