From kamen at cybuild.com Fri Jul 6 10:41:17 2007 From: kamen at cybuild.com (Kamen TOMOV) Date: Fri, 06 Jul 2007 13:41:17 +0300 Subject: [bknr-devel] objects with transient slots Message-ID: Hi, It is said in the datastore-manual: "... you can specify that a certain slot is transient, which means that it will not be snapshotted and that its value can be changed outside of a transaction." In my application the value of a transient slot is specified on object creation. When reloading the transaction log (server restart) the transient slot is bound and its value is correct. Is this intended behaviour or not? How is snapshotting the database different in that context? Thanks in advance, -- Kamen From hans at huebner.org Fri Jul 6 10:47:01 2007 From: hans at huebner.org (=?ISO-8859-1?Q?Hans_H=FCbner?=) Date: Fri, 6 Jul 2007 12:47:01 +0200 Subject: [bknr-devel] objects with transient slots In-Reply-To: References: Message-ID: Hi Kamen, are you saying that your transient slots are written to the transaction log and snapshot? This is not the intended behavior. Can you verify the bug by writing some distinctive string to such a slot, snapshot and then look in the snapshot file for that string? Do you see the the value retained when restoring or when starting your lisp afresh? Thanks, Hans 2007/7/6, Kamen TOMOV : > > Hi, > > It is said in the datastore-manual: > > "... you can specify that a certain slot is transient, which means > that it will not be snapshotted and that its value can be changed > outside of a transaction." > > In my application the value of a transient slot is specified on object > creation. When reloading the transaction log (server restart) the > transient slot is bound and its value is correct. Is this intended > behaviour or not? How is snapshotting the database different in that > context? > > Thanks in advance, > > -- > Kamen > _______________________________________________ > bknr-devel mailing list > bknr-devel at common-lisp.net > http://common-lisp.net/cgi-bin/mailman/listinfo/bknr-devel > -------------- next part -------------- An HTML attachment was scrubbed... URL: From kamen at cybuild.com Fri Jul 6 11:44:47 2007 From: kamen at cybuild.com (Kamen TOMOV) Date: Fri, 06 Jul 2007 14:44:47 +0300 Subject: [bknr-devel] objects with transient slots In-Reply-To: ("Hans =?iso-8859-1?Q?H=FCbner=22's?= message of "Fri\, 6 Jul 2007 12\:47\:01 +0200") References: Message-ID: Hello Hans, Lets define a class: (define-persistent-class a () ((s1 :update :transient t) (s2 :update))) and make an instance of it: (let ((obj (make-object 'a :s1 23 :s2 "ar"))) ... and then modify its transient slot: (setf (a-s1 obj) 3) When I stop and start Lisp and do: (make-instance 'mp-store.... I get: (slot-value obj 's1) => 23 (slot-value obj 's2) => "ar" s1 is transient and one might expect it to be unbound, but it is not, so I wondered if it is a bug or a feature, cause I might decide to use it as a feature :-) However, I guess that if I snapshot and then restore the database the transient slot would be unbound (and that would prevent me from using it as a feature, but I probably need a persistent slot anyway). Am I correct? Regards, -- ????? ----- Original Message ----- From: Hans H?bner Sent: 06 ??? 2007 at 13:47 Subject: Re: [bknr-devel] objects with transient slots Hi Kamen, are you saying that your transient slots are written to the transaction log and snapshot? This is not the intended behavior. Can you verify the bug by writing some distinctive string to such a slot, snapshot and then look in the snapshot file for that string? Do you see the the value retained when restoring or when starting your lisp afresh? Thanks, Hans 2007/7/6, Kamen TOMOV : > > Hi, > > It is said in the datastore-manual: > > "... you can specify that a certain slot is transient, which means > that it will not be snapshotted and that its value can be changed > outside of a transaction." > > In my application the value of a transient slot is specified on object > creation. When reloading the transaction log (server restart) the > transient slot is bound and its value is correct. Is this intended > behaviour or not? How is snapshotting the database different in that > context? > > Thanks in advance, > > -- > Kamen > _______________________________________________ > bknr-devel mailing list > bknr-devel at common-lisp.net > http://common-lisp.net/cgi-bin/mailman/listinfo/bknr-devel > From hans at huebner.org Fri Jul 6 11:50:06 2007 From: hans at huebner.org (=?ISO-8859-1?Q?Hans_H=FCbner?=) Date: Fri, 6 Jul 2007 13:50:06 +0200 Subject: [bknr-devel] objects with transient slots In-Reply-To: References: Message-ID: Kamen, what you describes looks to me as if the :transient does not have any effect at all, so the question is what you'd want to use this as a feature for :) - Seriously, what you describe seems to be a bug, as :transient slots should never be logged. In fact, I am depending on this behavior in several places and I wonder how the store serializes the slots that I'm using. I'd recommend to use :transient the way that is described in the documentation, i.e. assume that such slots will not be restored. I will eventually fix this, but it will propably take a few days until I commit. -Hans 2007/7/6, Kamen TOMOV : > > Hello Hans, > > Lets define a class: > > (define-persistent-class a () > ((s1 :update :transient t) > (s2 :update))) > > and make an instance of it: > > (let ((obj (make-object 'a :s1 23 :s2 "ar"))) > ... > > and then modify its transient slot: > > (setf (a-s1 obj) 3) > > When I stop and start Lisp and do: > > (make-instance 'mp-store.... > > I get: > > (slot-value obj 's1) > => 23 > (slot-value obj 's2) > => "ar" > > s1 is transient and one might expect it to be unbound, but it is not, > so I wondered if it is a bug or a feature, cause I might decide to use > it as a feature :-) > > However, I guess that if I snapshot and then restore the database the > transient slot would be unbound (and that would prevent me from using > it as a feature, but I probably need a persistent slot anyway). Am I > correct? > > > Regards, > > -- > ????? > > > ----- Original Message ----- > From: Hans H?bner > Sent: 06 ??? 2007 at 13:47 > Subject: Re: [bknr-devel] objects with transient slots > > Hi Kamen, > > are you saying that your transient slots are written to the transaction > log > and snapshot? This is not the intended behavior. Can you verify the bug > by > writing some distinctive string to such a slot, snapshot and then look in > the snapshot file for that string? Do you see the the value retained when > restoring or when starting your lisp afresh? > > Thanks, > Hans > > 2007/7/6, Kamen TOMOV : > > > > Hi, > > > > It is said in the datastore-manual: > > > > "... you can specify that a certain slot is transient, which means > > that it will not be snapshotted and that its value can be changed > > outside of a transaction." > > > > In my application the value of a transient slot is specified on object > > creation. When reloading the transaction log (server restart) the > > transient slot is bound and its value is correct. Is this intended > > behaviour or not? How is snapshotting the database different in that > > context? > > > > Thanks in advance, > > > > -- > > Kamen > > _______________________________________________ > > bknr-devel mailing list > > bknr-devel at common-lisp.net > > http://common-lisp.net/cgi-bin/mailman/listinfo/bknr-devel > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From kamen at cybuild.com Fri Jul 6 17:05:37 2007 From: kamen at cybuild.com (Kamen TOMOV) Date: Fri, 06 Jul 2007 20:05:37 +0300 Subject: [bknr-devel] objects with transient slots In-Reply-To: ("Hans =?iso-8859-1?Q?H=FCbner=22's?= message of "Fri\, 6 Jul 2007 13\:50\:06 +0200") References: Message-ID: Hans, "transient" has some effect because none of the setf-s of slots of this kind are in the transaction log, only when suppling data in the :initarg they are written there. In the morning I built something that relies on that behaviour, but then realized that it might not be what was intended. That's why I mentioned taht this might be a feature ;) Anyway, I'll follow your advise - thanks for it! Perhaps wherever you use transient slots in your applications you setf them instead of using :initargs on them and in result they are never in the transaction log and things are fine. Regards, -- ????? ----- Original Message ----- From: Hans H?bner Sent: 06 ??? 2007 at 14:50 Subject: Re: [bknr-devel] objects with transient slots Kamen, what you describes looks to me as if the :transient does not have any effect at all, so the question is what you'd want to use this as a feature for :) - Seriously, what you describe seems to be a bug, as :transient slots should never be logged. In fact, I am depending on this behavior in several places and I wonder how the store serializes the slots that I'm using. I'd recommend to use :transient the way that is described in the documentation, i.e. assume that such slots will not be restored. I will eventually fix this, but it will propably take a few days until I commit. -Hans 2007/7/6, Kamen TOMOV : > > Hello Hans, > > Lets define a class: > > (define-persistent-class a () > ((s1 :update :transient t) > (s2 :update))) > > and make an instance of it: > > (let ((obj (make-object 'a :s1 23 :s2 "ar"))) > ... > > and then modify its transient slot: > > (setf (a-s1 obj) 3) > > When I stop and start Lisp and do: > > (make-instance 'mp-store.... > > I get: > > (slot-value obj 's1) > => 23 > (slot-value obj 's2) > => "ar" > > s1 is transient and one might expect it to be unbound, but it is not, > so I wondered if it is a bug or a feature, cause I might decide to use > it as a feature :-) > > However, I guess that if I snapshot and then restore the database the > transient slot would be unbound (and that would prevent me from using > it as a feature, but I probably need a persistent slot anyway). Am I > correct? > > > Regards, > > -- > ????? > > > ----- Original Message ----- > From: Hans H?bner > Sent: 06 ??? 2007 at 13:47 > Subject: Re: [bknr-devel] objects with transient slots > > Hi Kamen, > > are you saying that your transient slots are written to the transaction > log > and snapshot? This is not the intended behavior. Can you verify the bug > by > writing some distinctive string to such a slot, snapshot and then look in > the snapshot file for that string? Do you see the the value retained when > restoring or when starting your lisp afresh? > > Thanks, > Hans > > 2007/7/6, Kamen TOMOV : > > > > Hi, > > > > It is said in the datastore-manual: > > > > "... you can specify that a certain slot is transient, which means > > that it will not be snapshotted and that its value can be changed > > outside of a transaction." > > > > In my application the value of a transient slot is specified on object > > creation. When reloading the transaction log (server restart) the > > transient slot is bound and its value is correct. Is this intended > > behaviour or not? How is snapshotting the database different in that > > context? > > > > Thanks in advance, > > > > -- > > Kamen > > _______________________________________________ > > bknr-devel mailing list > > bknr-devel at common-lisp.net > > http://common-lisp.net/cgi-bin/mailman/listinfo/bknr-devel > > > From kamen at cybuild.com Fri Jul 6 17:05:37 2007 From: kamen at cybuild.com (Kamen TOMOV) Date: Fri, 06 Jul 2007 20:05:37 +0300 Subject: [bknr-devel] objects with transient slots In-Reply-To: ("Hans =?iso-8859-1?Q?H=FCbner=22's?= message of "Fri\, 6 Jul 2007 13\:50\:06 +0200") References: Message-ID: Hans, "transient" has some effect because none of the setf-s of slots of this kind are in the transaction log, only when suppling data in the :initarg they are written there. In the morning I built something that relies on that behaviour, but then realized that it might not be what was intended. That's why I mentioned taht this might be a feature ;) Anyway, I'll follow your advise - thanks for it! Perhaps wherever you use transient slots in your applications you setf them instead of using :initargs on them and in result they are never in the transaction log and things are fine. Regards, -- ????? ----- Original Message ----- From: Hans H?bner Sent: 06 ??? 2007 at 14:50 Subject: Re: [bknr-devel] objects with transient slots Kamen, what you describes looks to me as if the :transient does not have any effect at all, so the question is what you'd want to use this as a feature for :) - Seriously, what you describe seems to be a bug, as :transient slots should never be logged. In fact, I am depending on this behavior in several places and I wonder how the store serializes the slots that I'm using. I'd recommend to use :transient the way that is described in the documentation, i.e. assume that such slots will not be restored. I will eventually fix this, but it will propably take a few days until I commit. -Hans 2007/7/6, Kamen TOMOV : > > Hello Hans, > > Lets define a class: > > (define-persistent-class a () > ((s1 :update :transient t) > (s2 :update))) > > and make an instance of it: > > (let ((obj (make-object 'a :s1 23 :s2 "ar"))) > ... > > and then modify its transient slot: > > (setf (a-s1 obj) 3) > > When I stop and start Lisp and do: > > (make-instance 'mp-store.... > > I get: > > (slot-value obj 's1) > => 23 > (slot-value obj 's2) > => "ar" > > s1 is transient and one might expect it to be unbound, but it is not, > so I wondered if it is a bug or a feature, cause I might decide to use > it as a feature :-) > > However, I guess that if I snapshot and then restore the database the > transient slot would be unbound (and that would prevent me from using > it as a feature, but I probably need a persistent slot anyway). Am I > correct? > > > Regards, > > -- > ????? > > > ----- Original Message ----- > From: Hans H?bner > Sent: 06 ??? 2007 at 13:47 > Subject: Re: [bknr-devel] objects with transient slots > > Hi Kamen, > > are you saying that your transient slots are written to the transaction > log > and snapshot? This is not the intended behavior. Can you verify the bug > by > writing some distinctive string to such a slot, snapshot and then look in > the snapshot file for that string? Do you see the the value retained when > restoring or when starting your lisp afresh? > > Thanks, > Hans > > 2007/7/6, Kamen TOMOV : > > > > Hi, > > > > It is said in the datastore-manual: > > > > "... you can specify that a certain slot is transient, which means > > that it will not be snapshotted and that its value can be changed > > outside of a transaction." > > > > In my application the value of a transient slot is specified on object > > creation. When reloading the transaction log (server restart) the > > transient slot is bound and its value is correct. Is this intended > > behaviour or not? How is snapshotting the database different in that > > context? > > > > Thanks in advance, > > > > -- > > Kamen > > _______________________________________________ > > bknr-devel mailing list > > bknr-devel at common-lisp.net > > http://common-lisp.net/cgi-bin/mailman/listinfo/bknr-devel > > > From hans at huebner.org Sat Jul 7 06:08:37 2007 From: hans at huebner.org (=?ISO-8859-1?Q?Hans_H=FCbner?=) Date: Sat, 7 Jul 2007 08:08:37 +0200 Subject: [bknr-devel] objects with transient slots In-Reply-To: References: Message-ID: Hi Kamen, now I understand what you write and I consider this being a real bug. Transient slots should be initialized with their default-initargs/initforms, not with whatever has been specified at object creation time. Everything else would be confusing.in general. I will fix this and commit later on. Thanks for reporting! Hans 2007/7/6, Kamen TOMOV : > > Hans, > > "transient" has some effect because none of the setf-s of slots of > this kind are in the transaction log, only when suppling data in the > :initarg they are written there. > > In the morning I built something that relies on that behaviour, but > then realized that it might not be what was intended. That's why I > mentioned taht this might be a feature ;) Anyway, I'll follow your > advise - thanks for it! > > Perhaps wherever you use transient slots in your applications you setf > them instead of using :initargs on them and in result they are never > in the transaction log and things are fine. > > Regards, > > -- > ????? > > > ----- Original Message ----- > From: Hans H?bner > Sent: 06 ??? 2007 at 14:50 > Subject: Re: [bknr-devel] objects with transient slots > > Kamen, > > what you describes looks to me as if the :transient does not have any > effect > at all, so the question is what you'd want to use this as a feature for :) > - Seriously, what you describe seems to be a bug, as :transient slots > should never be logged. In fact, I am depending on this behavior in > several > places and I wonder how the store serializes the slots that I'm using. > > I'd recommend to use :transient the way that is described in the > documentation, i.e. assume that such slots will not be restored. I will > eventually fix this, but it will propably take a few days until I commit. > > -Hans > > 2007/7/6, Kamen TOMOV : > > > > Hello Hans, > > > > Lets define a class: > > > > (define-persistent-class a () > > ((s1 :update :transient t) > > (s2 :update))) > > > > and make an instance of it: > > > > (let ((obj (make-object 'a :s1 23 :s2 "ar"))) > > ... > > > > and then modify its transient slot: > > > > (setf (a-s1 obj) 3) > > > > When I stop and start Lisp and do: > > > > (make-instance 'mp-store.... > > > > I get: > > > > (slot-value obj 's1) > > => 23 > > (slot-value obj 's2) > > => "ar" > > > > s1 is transient and one might expect it to be unbound, but it is not, > > so I wondered if it is a bug or a feature, cause I might decide to use > > it as a feature :-) > > > > However, I guess that if I snapshot and then restore the database the > > transient slot would be unbound (and that would prevent me from using > > it as a feature, but I probably need a persistent slot anyway). Am I > > correct? > > > > > > Regards, > > > > -- > > ????? > > > > > > ----- Original Message ----- > > From: Hans H?bner > > Sent: 06 ??? 2007 at 13:47 > > Subject: Re: [bknr-devel] objects with transient slots > > > > Hi Kamen, > > > > are you saying that your transient slots are written to the transaction > > log > > and snapshot? This is not the intended behavior. Can you verify the > bug > > by > > writing some distinctive string to such a slot, snapshot and then look > in > > the snapshot file for that string? Do you see the the value retained > when > > restoring or when starting your lisp afresh? > > > > Thanks, > > Hans > > > > 2007/7/6, Kamen TOMOV : > > > > > > Hi, > > > > > > It is said in the datastore-manual: > > > > > > "... you can specify that a certain slot is transient, which means > > > that it will not be snapshotted and that its value can be changed > > > outside of a transaction." > > > > > > In my application the value of a transient slot is specified on object > > > creation. When reloading the transaction log (server restart) the > > > transient slot is bound and its value is correct. Is this intended > > > behaviour or not? How is snapshotting the database different in that > > > context? > > > > > > Thanks in advance, > > > > > > -- > > > Kamen > > > _______________________________________________ > > > bknr-devel mailing list > > > bknr-devel at common-lisp.net > > > http://common-lisp.net/cgi-bin/mailman/listinfo/bknr-devel > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From kamen at cybuild.com Wed Jul 11 13:49:08 2007 From: kamen at cybuild.com (Kamen TOMOV) Date: Wed, 11 Jul 2007 16:49:08 +0300 Subject: [bknr-devel] compilation with cmucl-19d Message-ID: Hi, Have you tried running the latest BKNR with cmucl-19d? I had an issue compiling the CXML package. I had to isolate the file character.lisp from the package to compile it (I don't use CXML anyway). The rest seems to work. -- Kamen From hans at huebner.org Wed Jul 11 20:17:35 2007 From: hans at huebner.org (=?ISO-8859-1?Q?Hans_H=FCbner?=) Date: Wed, 11 Jul 2007 22:17:35 +0200 Subject: [bknr-devel] compilation with cmucl-19d In-Reply-To: References: Message-ID: Hi Kamen, no, I have not tried cmucl lately. Is the problem you have a cxml problem or one that is in BKNR? -Hans 2007/7/11, Kamen TOMOV : > Hi, > > Have you tried running the latest BKNR with cmucl-19d? I had an issue > compiling the CXML package. I had to isolate the file character.lisp > from the package to compile it (I don't use CXML anyway). The rest > seems to work. > > -- > Kamen > _______________________________________________ > bknr-devel mailing list > bknr-devel at common-lisp.net > http://common-lisp.net/cgi-bin/mailman/listinfo/bknr-devel > From kamen at cybuild.com Thu Jul 12 07:29:14 2007 From: kamen at cybuild.com (Kamen TOMOV) Date: Thu, 12 Jul 2007 10:29:14 +0300 Subject: [bknr-devel] compilation with cmucl-19d In-Reply-To: ("Hans =?iso-8859-1?Q?H=FCbner=22's?= message of "Wed\, 11 Jul 2007 22\:17\:35 +0200") References: Message-ID: Hans, I beleive it is a CXML problem. It appears when you do: (asdf:oos 'asdf:load-op :cxml) Regards, -- ????? ----- Original Message ----- From: Hans H?bner Sent: 11 ??? 2007 at 23:17 Subject: Re: [bknr-devel] compilation with cmucl-19d Hi Kamen, no, I have not tried cmucl lately. Is the problem you have a cxml problem or one that is in BKNR? -Hans 2007/7/11, Kamen TOMOV : > Hi, > > Have you tried running the latest BKNR with cmucl-19d? I had an issue > compiling the CXML package. I had to isolate the file character.lisp > from the package to compile it (I don't use CXML anyway). The rest > seems to work. > > -- > Kamen > _______________________________________________ > bknr-devel mailing list > bknr-devel at common-lisp.net > http://common-lisp.net/cgi-bin/mailman/listinfo/bknr-devel > From kamen at cybuild.com Thu Jul 12 18:08:39 2007 From: kamen at cybuild.com (Kamen TOMOV) Date: Thu, 12 Jul 2007 21:08:39 +0300 Subject: [bknr-devel] compilation with cmucl-19d In-Reply-To: (Kamen TOMOV's message of "Thu\, 12 Jul 2007 10\:29\:14 +0300") References: Message-ID: Hans, CXML continued breaking the compilation so I isolated it completely from bknr-datastore. In order to do so I had to remove two dependancies - one in the bknr-utils package and one in bknr-indices. The dependancy in bknr-indices appears to be bogus and it was easy to remove. The dependancy in bknr-utils was not and in fact it might need a bit more work. Generally, I created a new module "xml" where I put the removed functionality. I don't know if this is the best idea (perhaps it belongs to some other module). I am sending you the diffs. I haven't tested it because I don't use many of the modules. I have worked only in the bknr/src directory so it might break stuff in your projects. Generally, it would be best if there are no dependancies, but as nothing is perfect let's make them less. Parhaps bknr-utils can be shortened more, but currently I do not have an immediate need for that. Regards, -- Kamen Index: xml-impex/package.lisp =================================================================== --- xml-impex/package.lisp (revision 2168) +++ xml-impex/package.lisp (working copy) @@ -13,6 +13,7 @@ #+sbcl :sb-pcl :bknr.utils + :bknr.xml :bknr.indices) (:export #:xml-class Index: bknr-impex.asd =================================================================== --- bknr-impex.asd (revision 2168) +++ bknr-impex.asd (working copy) @@ -21,7 +21,7 @@ :description "BKNR XML import/export" :long-description "" - :depends-on (:cl-interpol :cxml :bknr-utils :bknr-indices) + :depends-on (:cl-interpol :cxml :bknr-utils :bknr-xml :bknr-indices) :components ((:module "xml-impex" :components Index: packages.lisp =================================================================== --- packages.lisp (revision 2168) +++ packages.lisp (working copy) @@ -26,7 +26,7 @@ #:start-cron)) (defpackage :bknr.rss - (:use :cl :cl-user :cl-ppcre :bknr.utils :puri :cxml-xmls :bknr.datastore :bknr.indices :cxml) + (:use :cl :cl-user :cl-ppcre :bknr.utils :bknr.xml :puri :cxml-xmls :bknr.datastore :bknr.indices :cxml) (:export #:xml-escape #:*img-src-scanner* #:*a-href-scanner* @@ -189,6 +189,7 @@ :bknr.indices :bknr.impex :bknr.utils + :bknr.xml :bknr.events :bknr.user) (:shadowing-import-from :cl-interpol #:quote-meta-chars) Index: xml/package.lisp =================================================================== --- xml/package.lisp (revision 0) +++ xml/package.lisp (revision 0) @@ -0,0 +1,15 @@ +(in-package :cl-user) + +(defpackage :bknr.xml + (:use :cl + :cl-ppcre + :cl-interpol + :cxml-xmls) + (:export + #:node-children-nodes + #:find-child + #:find-children + #:node-string-body + #:node-attribute + #:node-child-string-body + #:node-to-html)) \ No newline at end of file Index: xml/xml.lisp =================================================================== --- xml/xml.lisp (revision 0) +++ xml/xml.lisp (revision 0) @@ -0,0 +1,63 @@ +(in-package :bknr.xml) + +(defun node-children-nodes (xml) + (remove-if-not #'consp (node-children xml))) + +(defun find-child (xml node-name) + (let ((children (node-children-nodes xml))) + (find node-name children :test #'string-equal :key #'node-name))) + +(defun find-children (xml node-name) + (let ((children (node-children-nodes xml))) + (find-all node-name children :test #'string-equal :key #'node-name))) + +(defun node-string-body (xml) + (let ((children (remove-if #'consp (node-children xml)))) + (if (every #'stringp children) + (apply #'concatenate 'string children) + (error "Some children are not strings")))) + +(defun node-attribute (xml attribute-name) + (cadr (assoc attribute-name (node-attrs xml) :test #'string-equal))) + +(defun node-child-string-body (xml node-name) + (let ((child (find-child xml node-name))) + (if (and child (consp child)) + (node-string-body child) + nil))) + +(defun node-to-html (node &optional (stream *standard-output*)) + (when (stringp node) + (write-string node) + (return-from node-to-html)) + (write-char #\< stream) + (when (node-ns node) + (write-string (node-ns node) stream) + (write-char #\: stream)) + (write-string (node-name node) stream) + (loop for (key value) in (node-attrs node) + do (write-char #\Space stream) + (write-string key stream) + (write-char #\= stream) + (write-char #\" stream) + (write-string value stream) + (write-char #\" stream)) + (if (node-children node) + (progn + (write-char #\> stream) + (write-char #\Newline stream) + (dolist (child (node-children node)) + (node-to-html child stream)) + (write-char #\< stream) + (write-char #\/ stream) + (when (node-ns node) + (write-string (node-ns node) stream) + (write-char #\: stream)) + (write-string (node-name node) stream) + (write-char #\> stream) + (write-char #\Newline stream)) + (progn (write-char #\Space stream) + (write-char #\/ stream) + (write-char #\> stream) + (write-char #\Newline stream)))) + Index: bknr-utils.asd =================================================================== --- bknr-utils.asd (revision 2168) +++ bknr-utils.asd (working copy) @@ -17,7 +17,6 @@ :description "baikonour - launchpad for lisp satellites" :depends-on (:cl-interpol :cl-ppcre - :cxml :md5 #+(not allegro) :acl-compat @@ -37,7 +36,6 @@ (:file "base64" :depends-on ("utils")) (:file "capability" :depends-on ("utils")) (:file "make-fdf-file" :depends-on ("utils")) - (:file "xml" :depends-on ("utils")) (:file "date-calc") (:file "acl-mp-compat" :depends-on ("package")))))) Index: utils/package.lisp =================================================================== --- utils/package.lisp (revision 2168) +++ utils/package.lisp (working copy) @@ -4,7 +4,6 @@ (:use :cl :cl-ppcre :cl-interpol - :cxml-xmls :md5 #+cmu :extensions ; #+sbcl :sb-ext @@ -122,15 +121,6 @@ #:string-beginning-with-p #:string-delimited-by-p - ;; xml - #:node-children-nodes - #:find-child - #:find-children - #:node-string-body - #:node-attribute - #:node-child-string-body - #:node-to-html - ;; crypt-md5 #:crypt-md5 #:verify-md5-password Index: utils/xml.lisp =================================================================== --- utils/xml.lisp (revision 2168) +++ utils/xml.lisp (working copy) @@ -1,63 +0,0 @@ -(in-package :bknr.utils) - -(defun node-children-nodes (xml) - (remove-if-not #'consp (node-children xml))) - -(defun find-child (xml node-name) - (let ((children (node-children-nodes xml))) - (find node-name children :test #'string-equal :key #'node-name))) - -(defun find-children (xml node-name) - (let ((children (node-children-nodes xml))) - (find-all node-name children :test #'string-equal :key #'node-name))) - -(defun node-string-body (xml) - (let ((children (remove-if #'consp (node-children xml)))) - (if (every #'stringp children) - (apply #'concatenate 'string children) - (error "Some children are not strings")))) - -(defun node-attribute (xml attribute-name) - (cadr (assoc attribute-name (node-attrs xml) :test #'string-equal))) - -(defun node-child-string-body (xml node-name) - (let ((child (find-child xml node-name))) - (if (and child (consp child)) - (node-string-body child) - nil))) - -(defun node-to-html (node &optional (stream *standard-output*)) - (when (stringp node) - (write-string node) - (return-from node-to-html)) - (write-char #\< stream) - (when (node-ns node) - (write-string (node-ns node) stream) - (write-char #\: stream)) - (write-string (node-name node) stream) - (loop for (key value) in (node-attrs node) - do (write-char #\Space stream) - (write-string key stream) - (write-char #\= stream) - (write-char #\" stream) - (write-string value stream) - (write-char #\" stream)) - (if (node-children node) - (progn - (write-char #\> stream) - (write-char #\Newline stream) - (dolist (child (node-children node)) - (node-to-html child stream)) - (write-char #\< stream) - (write-char #\/ stream) - (when (node-ns node) - (write-string (node-ns node) stream) - (write-char #\: stream)) - (write-string (node-name node) stream) - (write-char #\> stream) - (write-char #\Newline stream)) - (progn (write-char #\Space stream) - (write-char #\/ stream) - (write-char #\> stream) - (write-char #\Newline stream)))) - Index: bknr-xml.asd =================================================================== --- bknr-xml.asd (revision 0) +++ bknr-xml.asd (revision 0) @@ -0,0 +1,21 @@ +;; -*-Lisp-*- + +(in-package :cl-user) + +(defpackage :bknr.xml.system + (:use :cl :asdf)) + +(in-package :bknr.xml.system) + +(defsystem :bknr-xml + :name "baikonour" + :author "Hans Huebner " + :author "Manuel Odendahl " + :version "0" + :maintainer "Manuel Odendahl " + :licence "BSD" + :description "baikonour - launchpad for lisp satellites" + :depends-on (:cl-interpol :cxml) + :components ((:module "xml" :components ((:file "package") + (:file "xml"))))) + Index: bknr.asd =================================================================== --- bknr.asd (revision 2168) +++ bknr.asd (working copy) @@ -28,6 +28,7 @@ :cxml :unit-test :bknr-utils + :bknr-xml :puri ;:stem ;:mime Index: indices/package.lisp =================================================================== --- indices/package.lisp (revision 2168) +++ indices/package.lisp (working copy) @@ -6,7 +6,6 @@ #+cmu :ext #+sbcl :sb-ext :cl-user - :cxml :bknr.utils :bknr.skip-list #+allegro :aclmop From kamen at cybuild.com Thu Jul 12 18:08:39 2007 From: kamen at cybuild.com (Kamen TOMOV) Date: Thu, 12 Jul 2007 21:08:39 +0300 Subject: [bknr-devel] compilation with cmucl-19d In-Reply-To: (Kamen TOMOV's message of "Thu\, 12 Jul 2007 10\:29\:14 +0300") References: Message-ID: Hans, CXML continued breaking the compilation so I isolated it completely from bknr-datastore. In order to do so I had to remove two dependancies - one in the bknr-utils package and one in bknr-indices. The dependancy in bknr-indices appears to be bogus and it was easy to remove. The dependancy in bknr-utils was not and in fact it might need a bit more work. Generally, I created a new module "xml" where I put the removed functionality. I don't know if this is the best idea (perhaps it belongs to some other module). I am sending you the diffs. I haven't tested it because I don't use many of the modules. I have worked only in the bknr/src directory so it might break stuff in your projects. Generally, it would be best if there are no dependancies, but as nothing is perfect let's make them less. Parhaps bknr-utils can be shortened more, but currently I do not have an immediate need for that. Regards, -- Kamen Index: xml-impex/package.lisp =================================================================== --- xml-impex/package.lisp (revision 2168) +++ xml-impex/package.lisp (working copy) @@ -13,6 +13,7 @@ #+sbcl :sb-pcl :bknr.utils + :bknr.xml :bknr.indices) (:export #:xml-class Index: bknr-impex.asd =================================================================== --- bknr-impex.asd (revision 2168) +++ bknr-impex.asd (working copy) @@ -21,7 +21,7 @@ :description "BKNR XML import/export" :long-description "" - :depends-on (:cl-interpol :cxml :bknr-utils :bknr-indices) + :depends-on (:cl-interpol :cxml :bknr-utils :bknr-xml :bknr-indices) :components ((:module "xml-impex" :components Index: packages.lisp =================================================================== --- packages.lisp (revision 2168) +++ packages.lisp (working copy) @@ -26,7 +26,7 @@ #:start-cron)) (defpackage :bknr.rss - (:use :cl :cl-user :cl-ppcre :bknr.utils :puri :cxml-xmls :bknr.datastore :bknr.indices :cxml) + (:use :cl :cl-user :cl-ppcre :bknr.utils :bknr.xml :puri :cxml-xmls :bknr.datastore :bknr.indices :cxml) (:export #:xml-escape #:*img-src-scanner* #:*a-href-scanner* @@ -189,6 +189,7 @@ :bknr.indices :bknr.impex :bknr.utils + :bknr.xml :bknr.events :bknr.user) (:shadowing-import-from :cl-interpol #:quote-meta-chars) Index: xml/package.lisp =================================================================== --- xml/package.lisp (revision 0) +++ xml/package.lisp (revision 0) @@ -0,0 +1,15 @@ +(in-package :cl-user) + +(defpackage :bknr.xml + (:use :cl + :cl-ppcre + :cl-interpol + :cxml-xmls) + (:export + #:node-children-nodes + #:find-child + #:find-children + #:node-string-body + #:node-attribute + #:node-child-string-body + #:node-to-html)) \ No newline at end of file Index: xml/xml.lisp =================================================================== --- xml/xml.lisp (revision 0) +++ xml/xml.lisp (revision 0) @@ -0,0 +1,63 @@ +(in-package :bknr.xml) + +(defun node-children-nodes (xml) + (remove-if-not #'consp (node-children xml))) + +(defun find-child (xml node-name) + (let ((children (node-children-nodes xml))) + (find node-name children :test #'string-equal :key #'node-name))) + +(defun find-children (xml node-name) + (let ((children (node-children-nodes xml))) + (find-all node-name children :test #'string-equal :key #'node-name))) + +(defun node-string-body (xml) + (let ((children (remove-if #'consp (node-children xml)))) + (if (every #'stringp children) + (apply #'concatenate 'string children) + (error "Some children are not strings")))) + +(defun node-attribute (xml attribute-name) + (cadr (assoc attribute-name (node-attrs xml) :test #'string-equal))) + +(defun node-child-string-body (xml node-name) + (let ((child (find-child xml node-name))) + (if (and child (consp child)) + (node-string-body child) + nil))) + +(defun node-to-html (node &optional (stream *standard-output*)) + (when (stringp node) + (write-string node) + (return-from node-to-html)) + (write-char #\< stream) + (when (node-ns node) + (write-string (node-ns node) stream) + (write-char #\: stream)) + (write-string (node-name node) stream) + (loop for (key value) in (node-attrs node) + do (write-char #\Space stream) + (write-string key stream) + (write-char #\= stream) + (write-char #\" stream) + (write-string value stream) + (write-char #\" stream)) + (if (node-children node) + (progn + (write-char #\> stream) + (write-char #\Newline stream) + (dolist (child (node-children node)) + (node-to-html child stream)) + (write-char #\< stream) + (write-char #\/ stream) + (when (node-ns node) + (write-string (node-ns node) stream) + (write-char #\: stream)) + (write-string (node-name node) stream) + (write-char #\> stream) + (write-char #\Newline stream)) + (progn (write-char #\Space stream) + (write-char #\/ stream) + (write-char #\> stream) + (write-char #\Newline stream)))) + Index: bknr-utils.asd =================================================================== --- bknr-utils.asd (revision 2168) +++ bknr-utils.asd (working copy) @@ -17,7 +17,6 @@ :description "baikonour - launchpad for lisp satellites" :depends-on (:cl-interpol :cl-ppcre - :cxml :md5 #+(not allegro) :acl-compat @@ -37,7 +36,6 @@ (:file "base64" :depends-on ("utils")) (:file "capability" :depends-on ("utils")) (:file "make-fdf-file" :depends-on ("utils")) - (:file "xml" :depends-on ("utils")) (:file "date-calc") (:file "acl-mp-compat" :depends-on ("package")))))) Index: utils/package.lisp =================================================================== --- utils/package.lisp (revision 2168) +++ utils/package.lisp (working copy) @@ -4,7 +4,6 @@ (:use :cl :cl-ppcre :cl-interpol - :cxml-xmls :md5 #+cmu :extensions ; #+sbcl :sb-ext @@ -122,15 +121,6 @@ #:string-beginning-with-p #:string-delimited-by-p - ;; xml - #:node-children-nodes - #:find-child - #:find-children - #:node-string-body - #:node-attribute - #:node-child-string-body - #:node-to-html - ;; crypt-md5 #:crypt-md5 #:verify-md5-password Index: utils/xml.lisp =================================================================== --- utils/xml.lisp (revision 2168) +++ utils/xml.lisp (working copy) @@ -1,63 +0,0 @@ -(in-package :bknr.utils) - -(defun node-children-nodes (xml) - (remove-if-not #'consp (node-children xml))) - -(defun find-child (xml node-name) - (let ((children (node-children-nodes xml))) - (find node-name children :test #'string-equal :key #'node-name))) - -(defun find-children (xml node-name) - (let ((children (node-children-nodes xml))) - (find-all node-name children :test #'string-equal :key #'node-name))) - -(defun node-string-body (xml) - (let ((children (remove-if #'consp (node-children xml)))) - (if (every #'stringp children) - (apply #'concatenate 'string children) - (error "Some children are not strings")))) - -(defun node-attribute (xml attribute-name) - (cadr (assoc attribute-name (node-attrs xml) :test #'string-equal))) - -(defun node-child-string-body (xml node-name) - (let ((child (find-child xml node-name))) - (if (and child (consp child)) - (node-string-body child) - nil))) - -(defun node-to-html (node &optional (stream *standard-output*)) - (when (stringp node) - (write-string node) - (return-from node-to-html)) - (write-char #\< stream) - (when (node-ns node) - (write-string (node-ns node) stream) - (write-char #\: stream)) - (write-string (node-name node) stream) - (loop for (key value) in (node-attrs node) - do (write-char #\Space stream) - (write-string key stream) - (write-char #\= stream) - (write-char #\" stream) - (write-string value stream) - (write-char #\" stream)) - (if (node-children node) - (progn - (write-char #\> stream) - (write-char #\Newline stream) - (dolist (child (node-children node)) - (node-to-html child stream)) - (write-char #\< stream) - (write-char #\/ stream) - (when (node-ns node) - (write-string (node-ns node) stream) - (write-char #\: stream)) - (write-string (node-name node) stream) - (write-char #\> stream) - (write-char #\Newline stream)) - (progn (write-char #\Space stream) - (write-char #\/ stream) - (write-char #\> stream) - (write-char #\Newline stream)))) - Index: bknr-xml.asd =================================================================== --- bknr-xml.asd (revision 0) +++ bknr-xml.asd (revision 0) @@ -0,0 +1,21 @@ +;; -*-Lisp-*- + +(in-package :cl-user) + +(defpackage :bknr.xml.system + (:use :cl :asdf)) + +(in-package :bknr.xml.system) + +(defsystem :bknr-xml + :name "baikonour" + :author "Hans Huebner " + :author "Manuel Odendahl " + :version "0" + :maintainer "Manuel Odendahl " + :licence "BSD" + :description "baikonour - launchpad for lisp satellites" + :depends-on (:cl-interpol :cxml) + :components ((:module "xml" :components ((:file "package") + (:file "xml"))))) + Index: bknr.asd =================================================================== --- bknr.asd (revision 2168) +++ bknr.asd (working copy) @@ -28,6 +28,7 @@ :cxml :unit-test :bknr-utils + :bknr-xml :puri ;:stem ;:mime Index: indices/package.lisp =================================================================== --- indices/package.lisp (revision 2168) +++ indices/package.lisp (working copy) @@ -6,7 +6,6 @@ #+cmu :ext #+sbcl :sb-ext :cl-user - :cxml :bknr.utils :bknr.skip-list #+allegro :aclmop