だから私はクラスを持っています
(defclass foo ()
((a :initarg :a :accessor a)
(b :initarg :b :accessor b)))
(defclass bar (foo)
((c :initarg :c)))
そしてコンストラクター
(defun make-foo (a b)
(make-instance 'foo :a a :b b))
既存の を取り込み、追加のスロットが定義されたFOO
を生成する関数を定義する簡単な方法はありますか? つまり、すべてのスロットを次のようにリストする必要はありません。BAR
C
(defun make-bar-from-foo (existing-foo c)
(make-instance 'bar :a (a existing-foo) :b (b existing-foo) :c c))