(define mylist (list (list 'a (list 'b 'c)) (list 'b (list 'a 'd))
(list 'c (list 'a 'd)) (list 'd (list 'c 'b 'a))))
(define (total1 L)
(+ (length (cdr (car L))) (total1 (cdr L))))
My aim is count lengths of sublists and sum this values.
length (('b 'c) + ('a 'd) + ('a 'd) + ('c 'b 'a))
So my function should return 9. But when I call this function, I get this error:
car: contract violation expected: pair? given: ()
What I should do?