(cond ((null list) nil) ;This is true if we are not at the end of the list?
Run Code Online (Sandbox Code Playgroud)
而
(cond ((null lst) '()) ; this means we are at the empty set?
Run Code Online (Sandbox Code Playgroud)
不太确定这些是如何不同的,任何人都可以帮忙吗?
非常感谢
他们并没有什么不同.nil
并且'()
在Lisp中表示完全相同的对象:
[1]> (eq nil '())
T
Run Code Online (Sandbox Code Playgroud)
有些人会告诉你用来nil
表示布尔值false,'()
或者()
用于表示空列表.不过,这只是编码风格的问题.
归档时间: |
|
查看次数: |
186 次 |
最近记录: |