3
理想的情況下LISP:爲什麼caddr [(A B C)] = C?
caddr[(A B C)] = car[cdr[cdr[(A B C)]]] = car[cdr[(B C)]] = car[C] = Undefined.
但書上說的答案是C
。任何人都可以解釋嗎?
非常感謝。
理想的情況下LISP:爲什麼caddr [(A B C)] = C?
caddr[(A B C)] = car[cdr[cdr[(A B C)]]] = car[cdr[(B C)]] = car[C] = Undefined.
但書上說的答案是C
。任何人都可以解釋嗎?
非常感謝。
你的錯誤是CDR [(BC)]是列表(C),而不是原子C.
然後汽車[(C)]爲C.
(CDR「(BC) )是列表(c),而不是原子c,因此表達式變成(汽車'(c))不是(汽車c)
? (cdr '(b c))
(C)
? (car '(c))
C
ohh好吧..去吧..汽車[(c)] =汽車[(C.NIL)] = C ..謝謝艾拉 – nrb