开发者

How do you express Boolean negation in Scheme?

开发者 https://www.devze.com 2023-02-27 15:56 出处:网络
In C and C++, the ! negates the result: if( !( a == b ) ) In S开发者_JAVA百科cheme, I found only eq?. How do I say \"not equal\"? Or we have to explicitly say

In C and C++, the ! negates the result:

if( !( a == b ) )

In S开发者_JAVA百科cheme, I found only eq?. How do I say "not equal"? Or we have to explicitly say

(eq? #f (eq? expr expr))


Scheme has a not, so you could do: (not (eq? expr1 expr2))


Could you not have tried guessing?

(not #f) ==> #t
0

精彩评论

暂无评论...
验证码 换一张
取 消