Ideally in LISP:
caddr[(A B C)] = car[cdr[cdr[(A B C)]]] = car[cdr[(B C)]] = car[C] = Undefined.
But the book says answer is C
. Can anyone please explain?
Thanks a lot.
Your mistake is that cdr[(B C)] is the list (C), not the atom C.
Then car[(C)] is C.
(cdr '(b c)) is the list (c), not the atom c, so the expression becomes (car '(c)) not (car c)
? (cdr '(b c))
(C)
? (car '(c))
C