[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

question regarding initialize-instance

i have the following class

(defclass vgdb () ((name :initarg name :accessor name)
                   (modes :initarg modes :accessor modes)
                   (h :accessor h)))
and the following initialize-instance

(defmethod initialize-instance :after ((v vgdb) &rest i)
   (with-open-file (in (name v) :direction (modes v)) (setf (h v) (read in))))

when i execute these expressions i get the warning
The generic function #<GENERIC-FUNCTION INITIALIZE-INSTANCE> is being modified, but has already been called.

what i am trying to do is to load a hash table after name gets set with the
contents of the file referred to by name.

my question: is this the proper use of initialize-instance or is there
a more correct way of doing this.  also where did initialize instance
get called for this class.
dan stanger