From ml13 at onlinehome.de Sun Mar 12 20:20:41 2006 From: ml13 at onlinehome.de (Kilian Sprotte) Date: Sun, 12 Mar 2006 21:20:41 +0100 Subject: [cl-store-devel] structure-objects for openmcl Message-ID: <46007C87-3215-42F6-A6A9-C2DB374CBF9A@onlinehome.de> Hi Sean, I am very happy that cl-store is continuously improving - its quite an important lib, I think. Just playing around a little with openmcl revealed that storing a structure is not that hard. I am not sure, if it is a nice way of doing like so, have a look at the diff against latest CVS, if you like. (structure-object.[1-3] do pass...) Cheers, Kilian Sprotte --- orig/default-backend.lisp +++ mod/default-backend.lisp @@ -418,6 +418,11 @@ (output-type-code +standard-object-code+ stream) (store-type-object obj stream)) +#+openmcl +(defstore-cl-store (obj structure-object stream) + (output-type-code +structure-object-code+ stream) + (store-type-object obj stream)) + (defstore-cl-store (obj condition stream) (output-type-code +condition-code+ stream) (store-type-object obj stream)) @@ -442,6 +447,10 @@ (defrestore-cl-store (standard-object stream) (restore-type-object stream)) +#+openmcl +(defrestore-cl-store (structure-object stream) + (restore-type-object stream)) + (defrestore-cl-store (condition stream) (restore-type-object stream)) --- orig/tests.lisp +++ mod/tests.lisp @@ -330,11 +330,11 @@ (defstruct (b (:include a)) d e f) -#+(or sbcl cmu lispworks) +#+(or sbcl cmu lispworks openmcl) (deftestit structure-object.1 (make-a :a 1 :b 2 :c 3)) -#+(or sbcl cmu lispworks) +#+(or sbcl cmu lispworks openmcl) (deftestit structure-object.2 (make-b :a 1 :b 2 :c 3 :d 4 :e 5 :f 6)) -#+(or sbcl cmu lispworks) +#+(or sbcl cmu lispworks openmcl) (deftestit structure-object.3 (make-b :a 1 :b (make-a :a 1 :b 3 :c 2) :c #\Space :d #(1 2 3) :e (list 1 2 3) :f (make-hash-table))) --- orig/utils.lisp +++ mod/utils.lisp @@ -23,7 +23,7 @@ and the objects class") (:method ((object standard-object)) (serializable-slots-using-class object (class-of object))) -#+(or sbcl cmu) +#+(or sbcl cmu openmcl) (:method ((object structure-object)) (serializable-slots-using-class object (class-of object))) (:method ((object condition)) @@ -37,7 +37,7 @@ The default calls compute slots with class") (:method ((object t) (class standard-class)) (compute-slots class)) -#+(or sbcl cmu) +#+(or sbcl cmu openmcl) (:method ((object t) (class structure-class)) (compute-slots class)) #+sbcl @@ -56,14 +56,25 @@ as an argument to ensure-class") (:method ((slot-definition #+(or ecl clisp) t #-(or ecl clisp) slot-definition)) - (list :name (slot-definition-name slot-definition) - :allocation (slot-definition-allocation slot-definition) - :initargs (slot-definition-initargs slot-definition) - ;; :initform. dont use initform until we can - ;; serialize functions - :readers (slot-definition-readers slot-definition) - :type (slot-definition-type slot-definition) - :writers (slot-definition-writers slot-definition)))) + (list :name (slot-definition-name slot-definition) + :allocation (slot-definition-allocation slot-definition) + :initargs (slot-definition-initargs slot-definition) + ;; :initform. dont use initform until we can + ;; serialize functions + :readers (slot-definition-readers slot-definition) + :type (slot-definition-type slot-definition) + :writers (slot-definition-writers slot-definition))) + #+openmcl + (:method ((slot-definition ccl::structure-slot-definition)) + (list :name (slot-definition-name slot-definition) + :allocation (slot-definition-allocation slot-definition) + :initargs (slot-definition-initargs slot-definition) + ;; :initform. dont use initform until we can + ;; serialize functions + ;; :readers (slot-definition-readers slot-definition) + :type (slot-definition-type slot-definition) + ;; :writers (slot-definition-writers slot-definition) + ))) (defmacro when-let ((var test) &body body) `(let ((,var ,test)) From sean at guruhut.com Tue Mar 14 07:16:38 2006 From: sean at guruhut.com (Sean Ross) Date: Tue, 14 Mar 2006 09:16:38 +0200 Subject: [cl-store-devel] structure-objects for openmcl In-Reply-To: <46007C87-3215-42F6-A6A9-C2DB374CBF9A@onlinehome.de> References: <46007C87-3215-42F6-A6A9-C2DB374CBF9A@onlinehome.de> Message-ID: <44166DD6.2000306@guruhut.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Kilian Sprotte wrote: > Hi Sean, > > I am very happy that cl-store is continuously improving - its quite an > important lib, I think. Just playing around a little with openmcl > revealed that storing a structure is not that hard. > > I am not sure, if it is a nice way of doing like so, have a look at the > diff against latest CVS, if you like. (structure-object.[1-3] do pass...) Hi, thanks for the patch, I'll apply it to cvs today. Just a quick question though, I noticed that get-slot-details conditionalized for openmcl excludes the readers and writers, I'm assuming that this is correct and works properly, unfortunately I don't have a Mac so I'm just going to patch as is. Cheers, Sean. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFEFm3Wc3my745Ad1oRAnYhAJ9OyKzukC4xLS3PDwGz6LqbUa7lfwCgwu2r 6dIJJ2M8V8F0wLCVXSYt4Ts= =6kY0 -----END PGP SIGNATURE----- From ml13 at onlinehome.de Tue Mar 14 10:27:04 2006 From: ml13 at onlinehome.de (Kilian Sprotte) Date: Tue, 14 Mar 2006 11:27:04 +0100 Subject: [cl-store-devel] structure-objects for openmcl In-Reply-To: <44166DD6.2000306@guruhut.com> References: <46007C87-3215-42F6-A6A9-C2DB374CBF9A@onlinehome.de> <44166DD6.2000306@guruhut.com> Message-ID: <80CC7DD3-7E7A-4386-8152-5C6A40338D9D@onlinehome.de> Am 14.03.2006 um 08:16 schrieb Sean Ross: > Just a quick question though, I noticed that get-slot-details > conditionalized for openmcl excludes the readers and writers, > I'm assuming that this is correct and works properly, > unfortunately I don't have a Mac so I'm just going to patch as is. Hi Sean, in fact, I did not find a MOP function to find out.... I was surprised myself that this information does not seem to be needed - even for circularity stuff. BTW I have seen on the TODO that you are going to revive the xml backend - I think it is a very good idea, it would give me the feeling on being able to store data more permanently... Would this be some of your intentions too? Ciao, Kilian -------------- next part -------------- An HTML attachment was scrubbed... URL: From sean at guruhut.com Tue Mar 14 11:04:44 2006 From: sean at guruhut.com (Sean Ross) Date: Tue, 14 Mar 2006 13:04:44 +0200 Subject: [cl-store-devel] structure-objects for openmcl In-Reply-To: <80CC7DD3-7E7A-4386-8152-5C6A40338D9D@onlinehome.de> References: <46007C87-3215-42F6-A6A9-C2DB374CBF9A@onlinehome.de> <44166DD6.2000306@guruhut.com> <80CC7DD3-7E7A-4386-8152-5C6A40338D9D@onlinehome.de> Message-ID: <4416A34C.9020706@guruhut.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Kilian Sprotte wrote: > > > Hi Sean, > > in fact, I did not find a MOP function to find out.... I was surprised > myself that this information does not seem to be needed - even for > circularity stuff. Hi Kilian, I've just committed the code, thanks again. Would you be able to test it because I moved some of the code around a bit? Currently the MOP stuff (currently imported from openmcl-mop) is only really used for serializing objects and classes, the circularity stuff doesn't (or at least shouldn't) really use it. > BTW I have seen on the TODO that you are going to revive the xml backend > - I think it is a very good idea, it would give me the feeling on being > able to store data more permanently... Would this be some of your > intentions too? I don't know how much I would actually use the xml backend but I think it's definitely a nice thing to have. I originally removed it because it was becoming a real pain updating both the cl-store backend and the xml-backend at the same time. Now that the cl-store one has more or less stabilized I'm getting ready to have another go at the xml, patches are always welcome of course :-) Cheers, Sean. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFEFqNLc3my745Ad1oRApemAKCc/Ef9iHk3PhVRlAFe3lUnLqcdWwCePXrk SA+Z1Ws0hjdv+lQyYIw8GDY= =HfvI -----END PGP SIGNATURE-----