next up previous
Next: 8.7 配列 Up: 8 CommonLispのデータとその比較手続き Previous: 8.5 文字列


8.6 構造体

構造体の比較において,構造体の要素の内容も 比較するためには,equalではだめで, equalpが必要です.
<cl> (defstruct test a b c)
TEST 
<cl> (setq a (make-test :a '(a b) :b "ab" :c 2))
#s(TEST :A (A B) :B "ab" :C 2) 
<cl> (setq b (make-test :a '(a b) :b "ab" :c 2))
#s(TEST :A (A B) :B "ab" :C 2) 
<cl> (eq a b)
NIL 
<cl> (eql a b)
NIL 
<cl> (equal a b)
NIL 
<cl> (equalp a b)
T


generated through LaTeX2HTML. M.Inaba 平成18年5月7日