From thomas at src.no Tue Feb 15 12:01:32 2005 From: thomas at src.no (Thomas Stenhaug) Date: Tue, 15 Feb 2005 13:01:32 +0100 Subject: [Cl-store-devel] Patch for more comprehensive handling of packages Message-ID: <4211E49C.3010109@src.no> I make and manipulate packages at runtime, so I needed to serialize and deserialize their state. That's what the patch is for. cl-store is great stuff, btw. :) Thomas -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: more-comprehensive-package-handling.diff URL: From sdr at jhb.ucs.co.za Wed Feb 16 13:27:21 2005 From: sdr at jhb.ucs.co.za (Sean Ross) Date: 16 Feb 2005 15:27:21 +0200 Subject: [Cl-store-devel] Patch for more comprehensive handling of packages References: <4211E49C.3010109@src.no> Message-ID: <87u0oc63eu.fsf@sdr.ucs.co.za> Thomas Stenhaug writes: > I make and manipulate packages at runtime, so I needed to serialize > and deserialize their state. That's what the patch is for. > > cl-store is great stuff, btw. :) > > > Thomas Hi, Thanks for the patch. I've applied it to cvs with a few modifications. The gist of the patch is the same but I've changed external-symbols and internal-symbols to return a vector since lispworks can choke when restoring large lists, internal-symbols is also a little more choosy and will ignore internal symbols which came from packages on it's use list. I also added package-shadowing-symbols to the stored values. The last change was a variable which determines whether to store the packages on the use list as full packages or as a package-name. BTW, I was reading through old cmucl archives and came across a post from Erik Enge which said that you were writing cl-pile which has 'transactions and several other neat features' so I was wondering if you have any ideas for new features for cl-store. - 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. From thomas at src.no Wed Feb 16 13:55:45 2005 From: thomas at src.no (Thomas Stenhaug) Date: Wed, 16 Feb 2005 14:55:45 +0100 Subject: [Cl-store-devel] Patch for more comprehensive handling of packages In-Reply-To: <87u0oc63eu.fsf@sdr.ucs.co.za> References: <4211E49C.3010109@src.no> <87u0oc63eu.fsf@sdr.ucs.co.za> Message-ID: <421350E1.6060803@src.no> Sean Ross wrote: > > I've applied it to cvs with a few modifications. > Great stuff! Thanks. > > BTW, I was reading through old cmucl archives and came across a post > from Erik Enge which said that you were writing cl-pile which has > 'transactions and several other neat features' so I was wondering > if you have any ideas for new features for cl-store. > > What I'm trying to do is actually to replace my own serialization-code in cl-pile with cl-store, since cl-store is more comprehensive, faster, better tested and documented. :) cl-pile is an implementation of the prevalance [1] idea, with some MOP extensions for giving classes, objects and slots things like title, description, creation-date etc. If the experiment of using cl-store for the serialization-layer, I'll try to seperate out the prevalence-parts of it, and let you look at it, to see if it's of interest. ---- [1] http://www-106.ibm.com/developerworks/library/wa-objprev/ From thomas at src.no Wed Feb 16 15:22:34 2005 From: thomas at src.no (Thomas Stenhaug) Date: Wed, 16 Feb 2005 16:22:34 +0100 Subject: [Cl-store-devel] Making GET-SLOT-DETAILS a generic Message-ID: <4213653A.1080100@src.no> 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. Thomas -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: generic-get-slot-details.diff URL: From sdr at jhb.ucs.co.za Thu Feb 17 10:04:09 2005 From: sdr at jhb.ucs.co.za (Sean Ross) Date: 17 Feb 2005 12:04:09 +0200 Subject: [Cl-store-devel] Making GET-SLOT-DETAILS a generic References: <4213653A.1080100@src.no> Message-ID: <87hdkbbizq.fsf@sdr.ucs.co.za> Thomas Stenhaug 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. From thomas at src.no Thu Feb 17 10:51:57 2005 From: thomas at src.no (Thomas Stenhaug) Date: Thu, 17 Feb 2005 11:51:57 +0100 Subject: [Cl-store-devel] Making GET-SLOT-DETAILS a generic In-Reply-To: <87hdkbbizq.fsf@sdr.ucs.co.za> References: <4213653A.1080100@src.no> <87hdkbbizq.fsf@sdr.ucs.co.za> Message-ID: <4214774D.5060209@src.no> Sean Ross wrote: > (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. > > Great! FWIW, that's the same solution I used in my serialization-library too. Thomas From sdr at jhb.ucs.co.za Fri Feb 18 12:44:23 2005 From: sdr at jhb.ucs.co.za (Sean Ross) Date: 18 Feb 2005 14:44:23 +0200 Subject: [Cl-store-devel] [Announce] CL-STORE 0.5 Message-ID: <87braiujfc.fsf@sdr.ucs.co.za> CL-STORE 0.5 has just been uploaded to cl.net and can now be downloaded or asdf-installed. Noteworthy Changes ====================== * New Magic Number, breaking backward compatibility. * Support for storing structure definitions with CMUCL. * cl-store-xml.asd has been removed. * Bug fix on hash-table restoration. * Argument order on most GF's have been reorganized to have the backend first. * fix-clisp.lisp renamed to mop.lisp * Support added for ECL. * resolving-object and setting have been reworked allowing setting be used like setf, *postfix-setters* has been removed. * Backend designators have been added allowing the backend argument to store, restore and with-backend to be either a backend-object or a backend name. * defrestore-? macros now expand to generic-functions so these macros now accept optional qualifier arguments. * stream-type of backends have been changed from char and binary to anything acceptable as an element-type argument to open. * multiple-value-store has been removed. * Floating point numbers are now portable between implementations while still supporting Nan floats and friends. * Bug Fix for standard-class serialization from Thomas Stenhaug. * Packages are now fully stored (Thanks to Thomas Stenhaug). * New Exported Method, get-slot-details which can be specialized when store a classes slots (Thanks to Thomas Stenhaug). * New Exported Methods, serializable-slots and serializable-slots-using-class which can be used to customize which slots are serialized when storing clos instances. Many apologies for any breakages. Enjoy, 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.