I have two classes, one an "ephemeral" and one persistent.  The persistent
class inherits from the ephemeral class.   When I copy slot values from an
ephemeral instance to persistent instance, only the slots that are redefined
in the persistent class get persisted properly, the other inherited slots
are not, as if they were marked transient by default.  Is this the correct
behaviour?   Is there a way to make all inherited slots persistent?

In the example below only slots 'last-name' and 'username' get persisted
when copying from 'site-user-ephemeral instance to 'site-user instance.

Yarek

(defclass site-user-ephemeral ()
  ((first-name
     :accessor    site-user-first-name
     :initarg    :first-name
     :type    string)
   (last-name
     :accessor    site-user-last-name
     :initarg    :last-name
     :type    string)
   (username
     :accessor    site-user-username
     :initarg    :username
     :type    string)
   (email
     :accessor    site-user-email
     :initarg    :email
     :type    string)
   (password
     :accessor    site-user-password
     :initarg    :password
     :type    string))
  (:documentation "object for storing user data"))

(defpclass site-user (site-user-ephemeral)
  ((last-name)
   (username
     :index    t))
  (:index t)
  (:documentation "persistent object for storing user data"))
_______________________________________________
elephant-devel site list
elephant-devel@common-lisp.net
http://common-lisp.net/mailman/listinfo/elephant-devel

Reply via email to