Mombu the Programming Forum

Go Back   Mombu the Programming Forum > Programming > Importing slot values from an existing object
User Name
Password
REGISTER NOW! Mark Forums Read




Reply
11 12th March 11:50
chaitanya
External User
 
Posts: 1
Default Importing slot values from an existing object



There's more than two classes. I have one base class, and a few
subclasses with specialized methods for them. I want to preserve the
original object so I can export its slots to instances of different subclasses. Chaitanya
  Reply With Quote


 


12 17th March 02:00
rpw3
External User
 
Posts: 1
Default Importing slot values from an existing object



| > Sounds even fishier. What would the names of the two classes be?
|
| There's more than two classes. I have one base class, and a few
| subclasses with specialized methods for them. I want to preserve the
| original object so I can export its slots to instances of different
| subclasses.
+---------------

Is there only one such "original object"? Are the values of its
slots essentially read-only? If so, have you looked into using
the (:ALLOCATION :CLASS) slot option when defining A? Then all
instances of A, *including* all instances of B, will share the
same slots. [Well, for those slots of A for which you specify
(:ALLOCATION :CLASS)...]

If not, then maybe what you really want is not CLOS but a
prototype-based object system such as provided by, say, KR
(available as a part of the Garnet distribution or now by
itself, see <http://www.cliki.net/KR>).
-Rob -----
Rob Warnock <rpw3@rpw3.org>
627 26th Avenue <URL:http://rpw3.org/>
San Mateo, CA 94403 (650)572-2607
  Reply With Quote


 


Reply


Thread Tools
Display Modes




666

Warning: Cannot modify header information - headers already sent by (output started at /www/docs/mombu.com/public_html/development/includes/functions.php:4362) in /includes/class_core.php on line 916

Warning: Cannot modify header information - headers already sent by (output started at /www/docs/mombu.com/public_html/development/includes/functions.php:4362) in /includes/class_core.php on line 917