[Cl-store-devel] Making GET-SLOT-DETAILS a generic

Sean Ross sdr at jhb.ucs.co.za
Thu Feb 17 10:04:09 UTC 2005


Thomas Stenhaug <thomas at src.no> writes:

> To be able to serialize non-standard slots, I made the
> GET-SLOT-DETAILS into a generic funtion, and exported it, so I can
> specialize on it.  Worked like a charm for me.

Thanks, 

 I've applied your patch (with a few conditialized statements to 
 handle ecl and clisp) to cvs. 

 I've also added the GF serializable-slots since most of the time
 you want to do custom serialization of objects is when you want
 to remove various slots from the list of slots to serialize 
 (at least thats what I found)

 so no you can do 
 
 (defclass foo () 
   ((a :accessor a :initarg :a)
    (b :accessor b :initarg :b)))
 
 (defmethod serializable-slots ((object foo))
   (remove 'b (call-next-method) :key 'slot-definition-name))
 
 to only serialize slot A.


 I guess you could do this with a metaclass and specializing
 compute-slots but that seems like a bit of a pain.
 
 

 Thanks for the patch.

-- Sean

-- 
"My doctor says that I have a malformed public-duty gland and a
 natural  deficiency in moral fibre," he muttered to himself, "and
 that I am therefore excused from saving Universes."
 - Life, the Universe, and Everything     Douglas Adams.




More information about the cl-store-devel mailing list