2008-11-13から1日間の記事一覧

クラスの再定義

CL-USER> (defclass foo () ((x :accessor foo-x :initform 1))) #<STANDARD-CLASS FOO> CL-USER> (defclass bar (foo) nil) #<STANDARD-CLASS BAR> CL-USER> (setq b (make-instance 'bar)) #<BAR #x1A3190F5> CL-USER> (setf (foo-x b) 10) 10 ;; y というスロットは存在しないよ! CL-USER> (slot-exists-p b 'y) N</bar></standard-class></standard-class>…