1

このような表現はエラーになります

(= nil 3)


Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil)
=(nil .......

my-eq次に、この式を次のように返すnil(False を意味する)簡単な方法 (たとえば、 と呼ばれる別の関数) はありますか?

(my-eq nil 3)
=> nil
4

1 に答える 1

3

それはeqまたはequalです。

(式 3 ゼロ)

=>なし

(eq OBJ1 OBJ2)

Return t if the two args are the same Lisp object.

(equal O1 O2)

Return t if two Lisp objects have similar structure and contents.
They must have the same data type.
Conses are compared by comparing the cars and the cdrs.
Vectors and strings are compared element by element.
Numbers are compared by value, but integers cannot equal floats.
 (Use `=' if you want integers and floats to be able to be equal.)
Symbols must match exactly.
于 2012-12-28T10:09:13.803 に答える