From: J. Kalita
Subject: A question about making a copy of an instance of an object
Date:
Message-ID: <593r45$b14@harpo.uccs.edu>
Hi!
I was wondering if someone can kindly answer a question
I have about CLOS. I am using the PCL implementation of it.
I want to make an exact copy of an existing instance of a
class. I have not been able to find a way to do this.
For example, I have defined a class called x-structure.
(defclass x-structure ()
((specifier :accessor x-specifier :initarg :specifier)
(head :accessor x-head :initarg :head)
(complement :accessor x-complement :initarg :complement)
)
)
Now, I have defined an instance of this structure called *VP-structure*.
(setf *VP-structure*
(make-instance 'x-structure
:specifier 'John
:head 'loves
:complement 'Mary)
)
Now, I want to make an exact copy of *VP-structure*, say
*VP-structure-2*. I am not sure how to go about it.
I am looking for something similar to the copier function,
"copy-structurename" function that becomes avaiable when
one defines a structure.
Thanks a lot!
Jugal Kalita