1
(cond ((null list) nil) ;This is true if we are not at the end of the list?
(cond ((null lst) '()) ; this means we are at the empty set?
不太清楚如何將這些不同的,任何人都可以幫忙嗎?
非常感謝
(cond ((null list) nil) ;This is true if we are not at the end of the list?
(cond ((null lst) '()) ; this means we are at the empty set?
不太清楚如何將這些不同的,任何人都可以幫忙嗎?
非常感謝
他們沒有什麼不同。 nil
和'()
表示完全一樣的物體用Lisp:
[1]> (eq nil '())
T
有些人會告訴你使用nil
表示布爾值false,並'()
或()
爲空列表。但這只是編碼風格的問題。
嗯,其實我想我可能會誤解(cond())。 對於第一種情況,如果列表爲空,則它的回答將爲零,而對於另一種情況,如果列表爲空,則回答爲空集合,那是正確的嗎?謝謝! 而你的回答我明白'()和零基本上是一樣的嗎? –
@GregorioDiStefano:'()'是空*列表*,而不是空* set *。否則,正確。 –
非常感謝! –