Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
理想情况下在 LISP 中:
caddr[(A B C)] = car[cdr[cdr[(A B C)]]] = car[cdr[(B C)]] = car[C] = Undefined.
但书上说答案是C。谁能解释一下?
C
非常感谢。
您的错误是 cdr[(BC)] 是列表 (C),而不是原子 C。
那么 car[(C)] 就是 C。
(cdr '(bc)) 是列表 (c),而不是原子 c,所以表达式变为 (car '(c)) 而不是 (car c)
? (cdr '(b c)) (C) ? (car '(c)) C