From marijnh at gmail.com Sat Mar 7 12:23:46 2009 From: marijnh at gmail.com (Marijn Haverbeke) Date: Sat, 7 Mar 2009 13:23:46 +0100 Subject: [postmodern-devel] Release 1.14 Message-ID: I've released 1.14. No major changes, but there was some small stuff sitting in the repo, and the half-year-old date of the last release made the project page look a bit dead ;). http://common-lisp.net/project/postmodern/postmodern-1.14.tgz Best, Marijn From info at jensteich.de Sat Mar 7 22:56:18 2009 From: info at jensteich.de (Jens Teich) Date: Sat, 07 Mar 2009 23:56:18 +0100 Subject: [postmodern-devel] Release 1.14 In-Reply-To: References: Message-ID: <49B2FB92.6090105@jensteich.de> Marijn Haverbeke schrieb: > I've released 1.14. No major changes, but there was some small stuff > sitting in the repo, and the half-year-old date of the last release > made the project page look a bit dead ;). Maybe it is a sign that the state is rather stable and not many bugs inside. Thanks for sharing your code! Jens From attila.lendvai at gmail.com Sun Mar 8 00:02:03 2009 From: attila.lendvai at gmail.com (Attila Lendvai) Date: Sun, 8 Mar 2009 01:02:03 +0100 Subject: [postmodern-devel] Release 1.14 In-Reply-To: References: Message-ID: > I've released 1.14. No major changes, but there was some small stuff does it mean that the default value of *silently-truncate-ratios* will remain T? (this is my last try, i promise... :) even if so, there's a patch in our repo that does some renaming for more clarity. i've recorded the T/NIL change in a standalone patch, so you can skip pulling it, but i think the other rename patch is useful. happy hacking, -- attila From marijnh at gmail.com Sun Mar 8 08:44:56 2009 From: marijnh at gmail.com (Marijn Haverbeke) Date: Sun, 8 Mar 2009 09:44:56 +0100 Subject: [postmodern-devel] Release 1.14 In-Reply-To: References: Message-ID: Hi Attila, The renaming makes some sense, but now I've already released and documented the old name, which isn't much worse, so I think I'll decline on that patch. About the default -- I still think a lot of people might be (intentionally or unintentionally) using ratios to fill float slots, so to me defaulting to T makes sense. People who care about precision can easily set the variable to NIL. Best, Marijn From attila.lendvai at gmail.com Sun Mar 8 22:17:21 2009 From: attila.lendvai at gmail.com (Attila Lendvai) Date: Sun, 8 Mar 2009 23:17:21 +0100 Subject: [postmodern-devel] Release 1.14 In-Reply-To: References: Message-ID: hello Marijn, > About the default -- I still think a lot of people might be > (intentionally or unintentionally) using ratios to fill float slots, > so to me defaulting to T makes sense. People who care about precision > can easily set the variable to NIL. users can certainly set it, that's why it was added... but only *AFTER* they have understood and realized the potential dangers, which may be a long time after going live and doing serious miscalculation leading to silent data "corruption"... but as i promised, it was my last try in this. i'm on the safe side by now anyway... :) happy hacking, -- attila From lucas.r.hope at gmail.com Tue Mar 10 00:11:25 2009 From: lucas.r.hope at gmail.com (Lucas Hope) Date: Tue, 10 Mar 2009 11:11:25 +1100 Subject: [postmodern-devel] Can't redefine slots as columns - why? Message-ID: <69fb852b0903091711u3bb53063r8ce16ef13213a140@mail.gmail.com> Hi there, I am just getting my feet wet with postmodern. It looks like I will be doing some heavy development with it for the next couple of weeks. Wish me luck! My (first?) issue is that I want to do something similar to the following example code. Here CIRCLE is an in-memory implementation of a circle, and it is desired to create a DAO object which moves storage to a postgres backend. (We have lots of circles...) Pretend CIRCLE has a host of useful functionality attached and I can't just point all the defmethods to DAO-CIRCLE. (defclass SHAPE () ()) (defclass CIRCLE (SHAPE) (radius)) (defclass DAO-CIRCLE (CIRCLE) ((radius :col-type real)) (:metaclass dao-class)) (dao-table-definition 'dao-circle) => ERROR: Slot RADIUS in class # is both a column slot and a regular slot. Why doesn't this work, and how can I make it work? It seems like this is useful functionality to have. I want the DAO-CIRCLE's radius to be a column slot. Cheers, -Luke From marijnh at gmail.com Tue Mar 10 07:19:08 2009 From: marijnh at gmail.com (Marijn Haverbeke) Date: Tue, 10 Mar 2009 08:19:08 +0100 Subject: [postmodern-devel] Can't redefine slots as columns - why? In-Reply-To: <69fb852b0903091711u3bb53063r8ce16ef13213a140@mail.gmail.com> References: <69fb852b0903091711u3bb53063r8ce16ef13213a140@mail.gmail.com> Message-ID: Hello Luke, I think (though I'm never entirely sure with this MOP stuff) that that error is only there becuase I hadn't thought of the way you are trying to use this metaclass, and assumed redefining a slot as a column was always an accident. Could you try killing the WHEN-form on line 97 of postmodern/table.lisp, doing what you're trying to do, and reporting back whether it works as hoped? Best, Marijn On Tue, Mar 10, 2009 at 1:11 AM, Lucas Hope wrote: > Hi there, > > I am just getting my feet wet with postmodern. ?It looks like I will > be doing some heavy development with it for the next couple of weeks. > Wish me luck! > > My (first?) issue is that I want to do something similar to the > following example code. ?Here CIRCLE is an in-memory implementation of > a circle, and it is desired to create a DAO object which moves storage > to a postgres backend. (We have lots of circles...) > > Pretend CIRCLE has a host of useful functionality attached and I can't > just point all the defmethods to DAO-CIRCLE. > > (defclass SHAPE () ()) > > (defclass CIRCLE (SHAPE) > ?(radius)) > > (defclass DAO-CIRCLE (CIRCLE) > ?((radius :col-type real)) > ?(:metaclass dao-class)) > > (dao-table-definition 'dao-circle) > => ERROR: Slot RADIUS in class # is both a > column slot and a regular slot. > > Why doesn't this work, and how can I make it work? ?It seems like this > is useful functionality to have. ?I want the DAO-CIRCLE's radius to be > a column slot. > > Cheers, > > -Luke > > _______________________________________________ > postmodern-devel mailing list > postmodern-devel at common-lisp.net > http://common-lisp.net/cgi-bin/mailman/listinfo/postmodern-devel > From lucas.r.hope at gmail.com Tue Mar 10 09:10:37 2009 From: lucas.r.hope at gmail.com (Lucas Hope) Date: Tue, 10 Mar 2009 20:10:37 +1100 Subject: [postmodern-devel] Can't redefine slots as columns - why? In-Reply-To: References: <69fb852b0903091711u3bb53063r8ce16ef13213a140@mail.gmail.com> Message-ID: <69fb852b0903100210m482d75e6j2f528015fc6291b7@mail.gmail.com> Hi Marijn, I stubbed out the form and the dao-circle was successfully compiled (of course). However the example circle I tried to make did not have its slot value set. I understand (I think) what you were trying to do with the *direct-column-slot* special variable, but maybe in this case (on Allegro CL, btw), while the effective-slot-definition-class works correctly (indicated by the correct CREATE TABLE below), the actual effective-column-slot object is instantiated OUTSIDE the scope of the binding in compute-effective-slot-definitio which sets *direct-column-slot* to non-nil. There's no reason for the lisp implementation to instantiate the class returned by effective-column-slot immediately, as far as I can tell. (dao-table-definition 'dao-circle) ;; success! "CREATE TABLE dao_circle (radius REAL NOT NULL)" (setf circle (make-instance 'dao-circle :radius 5.0)) (slot-boundp circle 'radius) => NIL ;; fail. :( -Luke On Tue, Mar 10, 2009 at 6:19 PM, Marijn Haverbeke wrote: > Hello Luke, > > I think (though I'm never entirely sure with this MOP stuff) that that > error is only there becuase I hadn't thought of the way you are trying > to use this metaclass, and assumed redefining a slot as a column was > always an accident. Could you try killing the WHEN-form on line 97 of > postmodern/table.lisp, doing what you're trying to do, and reporting > back whether it works as hoped? > > Best, > Marijn > > > On Tue, Mar 10, 2009 at 1:11 AM, Lucas Hope wrote: >> Hi there, >> >> I am just getting my feet wet with postmodern. ?It looks like I will >> be doing some heavy development with it for the next couple of weeks. >> Wish me luck! >> >> My (first?) issue is that I want to do something similar to the >> following example code. ?Here CIRCLE is an in-memory implementation of >> a circle, and it is desired to create a DAO object which moves storage >> to a postgres backend. (We have lots of circles...) >> >> Pretend CIRCLE has a host of useful functionality attached and I can't >> just point all the defmethods to DAO-CIRCLE. >> >> (defclass SHAPE () ()) >> >> (defclass CIRCLE (SHAPE) >> ?(radius)) >> >> (defclass DAO-CIRCLE (CIRCLE) >> ?((radius :col-type real)) >> ?(:metaclass dao-class)) >> >> (dao-table-definition 'dao-circle) >> => ERROR: Slot RADIUS in class # is both a >> column slot and a regular slot. >> >> Why doesn't this work, and how can I make it work? ?It seems like this >> is useful functionality to have. ?I want the DAO-CIRCLE's radius to be >> a column slot. >> >> Cheers, >> >> -Luke >> >> _______________________________________________ >> postmodern-devel mailing list >> postmodern-devel at common-lisp.net >> http://common-lisp.net/cgi-bin/mailman/listinfo/postmodern-devel >> > > _______________________________________________ > postmodern-devel mailing list > postmodern-devel at common-lisp.net > http://common-lisp.net/cgi-bin/mailman/listinfo/postmodern-devel > -- --------------------------------------------------- Dr Lucas Hope - (646) 2332123 after 3pm US EST Machine Learning and Software Engineering Consultant Melbourne, Australia From marijnh at gmail.com Tue Mar 10 10:51:04 2009 From: marijnh at gmail.com (Marijn Haverbeke) Date: Tue, 10 Mar 2009 11:51:04 +0100 Subject: [postmodern-devel] Can't redefine slots as columns - why? In-Reply-To: <69fb852b0903100210m482d75e6j2f528015fc6291b7@mail.gmail.com> References: <69fb852b0903091711u3bb53063r8ce16ef13213a140@mail.gmail.com> <69fb852b0903100210m482d75e6j2f528015fc6291b7@mail.gmail.com> Message-ID: Ah, you are right. If the slot object has already been instantiated as a regular slot, I don't know of any safe, portable way to make it a column slot. If you can think of a hack to make this work, let me know. But for now, you'll have to solve this in some other way. Best, Marijn On Tue, Mar 10, 2009 at 10:10 AM, Lucas Hope wrote: > Hi Marijn, > > I stubbed out the form and the dao-circle was successfully compiled (of course). > > However the example circle I tried to make did not have its slot value > set. ?I understand (I think) what you were trying to do with the > *direct-column-slot* special variable, but maybe in this case (on > Allegro CL, btw), ?while the effective-slot-definition-class works > correctly (indicated by the correct CREATE TABLE below), ?the actual > effective-column-slot object is instantiated OUTSIDE the scope of the > binding in compute-effective-slot-definitio which sets > *direct-column-slot* to non-nil. > > There's no reason for the lisp implementation to instantiate the class > returned by effective-column-slot immediately, as far as I can tell. > > (dao-table-definition 'dao-circle) ;; success! > "CREATE TABLE dao_circle (radius REAL NOT NULL)" > > (setf circle (make-instance 'dao-circle :radius 5.0)) > > (slot-boundp circle 'radius) > => NIL ;; fail. :( > > -Luke > > On Tue, Mar 10, 2009 at 6:19 PM, Marijn Haverbeke wrote: >> Hello Luke, >> >> I think (though I'm never entirely sure with this MOP stuff) that that >> error is only there becuase I hadn't thought of the way you are trying >> to use this metaclass, and assumed redefining a slot as a column was >> always an accident. Could you try killing the WHEN-form on line 97 of >> postmodern/table.lisp, doing what you're trying to do, and reporting >> back whether it works as hoped? >> >> Best, >> Marijn >> >> >> On Tue, Mar 10, 2009 at 1:11 AM, Lucas Hope wrote: >>> Hi there, >>> >>> I am just getting my feet wet with postmodern. ?It looks like I will >>> be doing some heavy development with it for the next couple of weeks. >>> Wish me luck! >>> >>> My (first?) issue is that I want to do something similar to the >>> following example code. ?Here CIRCLE is an in-memory implementation of >>> a circle, and it is desired to create a DAO object which moves storage >>> to a postgres backend. (We have lots of circles...) >>> >>> Pretend CIRCLE has a host of useful functionality attached and I can't >>> just point all the defmethods to DAO-CIRCLE. >>> >>> (defclass SHAPE () ()) >>> >>> (defclass CIRCLE (SHAPE) >>> ?(radius)) >>> >>> (defclass DAO-CIRCLE (CIRCLE) >>> ?((radius :col-type real)) >>> ?(:metaclass dao-class)) >>> >>> (dao-table-definition 'dao-circle) >>> => ERROR: Slot RADIUS in class # is both a >>> column slot and a regular slot. >>> >>> Why doesn't this work, and how can I make it work? ?It seems like this >>> is useful functionality to have. ?I want the DAO-CIRCLE's radius to be >>> a column slot. >>> >>> Cheers, >>> >>> -Luke >>> >>> _______________________________________________ >>> postmodern-devel mailing list >>> postmodern-devel at common-lisp.net >>> http://common-lisp.net/cgi-bin/mailman/listinfo/postmodern-devel >>> >> >> _______________________________________________ >> postmodern-devel mailing list >> postmodern-devel at common-lisp.net >> http://common-lisp.net/cgi-bin/mailman/listinfo/postmodern-devel >> > > > > -- > --------------------------------------------------- > Dr Lucas Hope - (646) 2332123 after 3pm US EST > Machine Learning and Software Engineering Consultant > Melbourne, Australia > > _______________________________________________ > postmodern-devel mailing list > postmodern-devel at common-lisp.net > http://common-lisp.net/cgi-bin/mailman/listinfo/postmodern-devel > From lucas.r.hope at gmail.com Tue Mar 10 19:00:20 2009 From: lucas.r.hope at gmail.com (Lucas Hope) Date: Wed, 11 Mar 2009 06:00:20 +1100 Subject: [postmodern-devel] Can't redefine slots as columns - why? In-Reply-To: References: <69fb852b0903091711u3bb53063r8ce16ef13213a140@mail.gmail.com> <69fb852b0903100210m482d75e6j2f528015fc6291b7@mail.gmail.com> Message-ID: <69fb852b0903101200k687fa9b3n7b8b467f31419f97@mail.gmail.com> Hi Marijn, I guess I suffered from working 12 hours and then emailing you. My little example had a fatal flaw: I hadn't defined an :initarg for radius! Some preliminary (re-)testing indicates that your initial fix/alteration works. Thanks for your help! -Luke On Tue, Mar 10, 2009 at 9:51 PM, Marijn Haverbeke wrote: > Ah, you are right. If the slot object has already been instantiated as > a regular slot, I don't know of any safe, portable way to make it a > column slot. If you can think of a hack to make this work, let me > know. But for now, you'll have to solve this in some other way. > > Best, > Marijn > > > On Tue, Mar 10, 2009 at 10:10 AM, Lucas Hope wrote: >> Hi Marijn, >> >> I stubbed out the form and the dao-circle was successfully compiled (of course). >> >> However the example circle I tried to make did not have its slot value >> set. ?I understand (I think) what you were trying to do with the >> *direct-column-slot* special variable, but maybe in this case (on >> Allegro CL, btw), ?while the effective-slot-definition-class works >> correctly (indicated by the correct CREATE TABLE below), ?the actual >> effective-column-slot object is instantiated OUTSIDE the scope of the >> binding in compute-effective-slot-definitio which sets >> *direct-column-slot* to non-nil. >> >> There's no reason for the lisp implementation to instantiate the class >> returned by effective-column-slot immediately, as far as I can tell. >> >> (dao-table-definition 'dao-circle) ;; success! >> "CREATE TABLE dao_circle (radius REAL NOT NULL)" >> >> (setf circle (make-instance 'dao-circle :radius 5.0)) >> >> (slot-boundp circle 'radius) >> => NIL ;; fail. :( >> >> -Luke >> >> On Tue, Mar 10, 2009 at 6:19 PM, Marijn Haverbeke wrote: >>> Hello Luke, >>> >>> I think (though I'm never entirely sure with this MOP stuff) that that >>> error is only there becuase I hadn't thought of the way you are trying >>> to use this metaclass, and assumed redefining a slot as a column was >>> always an accident. Could you try killing the WHEN-form on line 97 of >>> postmodern/table.lisp, doing what you're trying to do, and reporting >>> back whether it works as hoped? >>> >>> Best, >>> Marijn >>> >>> >>> On Tue, Mar 10, 2009 at 1:11 AM, Lucas Hope wrote: >>>> Hi there, >>>> >>>> I am just getting my feet wet with postmodern. ?It looks like I will >>>> be doing some heavy development with it for the next couple of weeks. >>>> Wish me luck! >>>> >>>> My (first?) issue is that I want to do something similar to the >>>> following example code. ?Here CIRCLE is an in-memory implementation of >>>> a circle, and it is desired to create a DAO object which moves storage >>>> to a postgres backend. (We have lots of circles...) >>>> >>>> Pretend CIRCLE has a host of useful functionality attached and I can't >>>> just point all the defmethods to DAO-CIRCLE. >>>> >>>> (defclass SHAPE () ()) >>>> >>>> (defclass CIRCLE (SHAPE) >>>> ?(radius)) >>>> >>>> (defclass DAO-CIRCLE (CIRCLE) >>>> ?((radius :col-type real)) >>>> ?(:metaclass dao-class)) >>>> >>>> (dao-table-definition 'dao-circle) >>>> => ERROR: Slot RADIUS in class # is both a >>>> column slot and a regular slot. >>>> >>>> Why doesn't this work, and how can I make it work? ?It seems like this >>>> is useful functionality to have. ?I want the DAO-CIRCLE's radius to be >>>> a column slot. >>>> >>>> Cheers, >>>> >>>> -Luke From marijnh at gmail.com Tue Mar 10 19:13:44 2009 From: marijnh at gmail.com (Marijn Haverbeke) Date: Tue, 10 Mar 2009 20:13:44 +0100 Subject: [postmodern-devel] Can't redefine slots as columns - why? In-Reply-To: <69fb852b0903101200k687fa9b3n7b8b467f31419f97@mail.gmail.com> References: <69fb852b0903091711u3bb53063r8ce16ef13213a140@mail.gmail.com> <69fb852b0903100210m482d75e6j2f528015fc6291b7@mail.gmail.com> <69fb852b0903101200k687fa9b3n7b8b467f31419f97@mail.gmail.com> Message-ID: Hi Luke, I have to admit that I don't really remember how direct slots and effective slots are supposed to work. If everything works as intended for you, I'll drop the test and allow slots from superclasses to be defined as column slots. Best, Marijn On Tue, Mar 10, 2009 at 8:00 PM, Lucas Hope wrote: > Hi Marijn, > > I guess I suffered from working 12 hours and then emailing you. > > My little example had a fatal flaw: I hadn't defined an :initarg for > radius! ?Some preliminary (re-)testing indicates that your initial > fix/alteration works. > > Thanks for your help! > > -Luke > > > On Tue, Mar 10, 2009 at 9:51 PM, Marijn Haverbeke wrote: >> Ah, you are right. If the slot object has already been instantiated as >> a regular slot, I don't know of any safe, portable way to make it a >> column slot. If you can think of a hack to make this work, let me >> know. But for now, you'll have to solve this in some other way. >> >> Best, >> Marijn >> >> >> On Tue, Mar 10, 2009 at 10:10 AM, Lucas Hope wrote: >>> Hi Marijn, >>> >>> I stubbed out the form and the dao-circle was successfully compiled (of course). >>> >>> However the example circle I tried to make did not have its slot value >>> set. ?I understand (I think) what you were trying to do with the >>> *direct-column-slot* special variable, but maybe in this case (on >>> Allegro CL, btw), ?while the effective-slot-definition-class works >>> correctly (indicated by the correct CREATE TABLE below), ?the actual >>> effective-column-slot object is instantiated OUTSIDE the scope of the >>> binding in compute-effective-slot-definitio which sets >>> *direct-column-slot* to non-nil. >>> >>> There's no reason for the lisp implementation to instantiate the class >>> returned by effective-column-slot immediately, as far as I can tell. >>> >>> (dao-table-definition 'dao-circle) ;; success! >>> "CREATE TABLE dao_circle (radius REAL NOT NULL)" >>> >>> (setf circle (make-instance 'dao-circle :radius 5.0)) >>> >>> (slot-boundp circle 'radius) >>> => NIL ;; fail. :( >>> >>> -Luke >>> >>> On Tue, Mar 10, 2009 at 6:19 PM, Marijn Haverbeke wrote: >>>> Hello Luke, >>>> >>>> I think (though I'm never entirely sure with this MOP stuff) that that >>>> error is only there becuase I hadn't thought of the way you are trying >>>> to use this metaclass, and assumed redefining a slot as a column was >>>> always an accident. Could you try killing the WHEN-form on line 97 of >>>> postmodern/table.lisp, doing what you're trying to do, and reporting >>>> back whether it works as hoped? >>>> >>>> Best, >>>> Marijn >>>> >>>> >>>> On Tue, Mar 10, 2009 at 1:11 AM, Lucas Hope wrote: >>>>> Hi there, >>>>> >>>>> I am just getting my feet wet with postmodern. ?It looks like I will >>>>> be doing some heavy development with it for the next couple of weeks. >>>>> Wish me luck! >>>>> >>>>> My (first?) issue is that I want to do something similar to the >>>>> following example code. ?Here CIRCLE is an in-memory implementation of >>>>> a circle, and it is desired to create a DAO object which moves storage >>>>> to a postgres backend. (We have lots of circles...) >>>>> >>>>> Pretend CIRCLE has a host of useful functionality attached and I can't >>>>> just point all the defmethods to DAO-CIRCLE. >>>>> >>>>> (defclass SHAPE () ()) >>>>> >>>>> (defclass CIRCLE (SHAPE) >>>>> ?(radius)) >>>>> >>>>> (defclass DAO-CIRCLE (CIRCLE) >>>>> ?((radius :col-type real)) >>>>> ?(:metaclass dao-class)) >>>>> >>>>> (dao-table-definition 'dao-circle) >>>>> => ERROR: Slot RADIUS in class # is both a >>>>> column slot and a regular slot. >>>>> >>>>> Why doesn't this work, and how can I make it work? ?It seems like this >>>>> is useful functionality to have. ?I want the DAO-CIRCLE's radius to be >>>>> a column slot. >>>>> >>>>> Cheers, >>>>> >>>>> -Luke > > _______________________________________________ > postmodern-devel mailing list > postmodern-devel at common-lisp.net > http://common-lisp.net/cgi-bin/mailman/listinfo/postmodern-devel > From lucas.r.hope at gmail.com Tue Mar 10 20:00:22 2009 From: lucas.r.hope at gmail.com (Lucas Hope) Date: Wed, 11 Mar 2009 07:00:22 +1100 Subject: [postmodern-devel] Can't redefine slots as columns - why? In-Reply-To: References: <69fb852b0903091711u3bb53063r8ce16ef13213a140@mail.gmail.com> <69fb852b0903100210m482d75e6j2f528015fc6291b7@mail.gmail.com> <69fb852b0903101200k687fa9b3n7b8b467f31419f97@mail.gmail.com> Message-ID: <69fb852b0903101300v6d47b308kcb3057b77fd7436@mail.gmail.com> Hi Marijn, It seems to work fine. If it was me, I'd remove the test, but wouldn't bother creating a new release just for this. Thanks for your work. :-) -Luke On Wed, Mar 11, 2009 at 6:13 AM, Marijn Haverbeke wrote: > Hi Luke, > > I have to admit that I don't really remember how direct slots and > effective slots are supposed to work. If everything works as intended > for you, I'll drop the test and allow slots from superclasses to be > defined as column slots. > > Best, > Marijn > > On Tue, Mar 10, 2009 at 8:00 PM, Lucas Hope wrote: >> Hi Marijn, >> >> I guess I suffered from working 12 hours and then emailing you. >> >> My little example had a fatal flaw: I hadn't defined an :initarg for >> radius! ?Some preliminary (re-)testing indicates that your initial >> fix/alteration works. >> >> Thanks for your help! >> >> -Luke >> >> >> On Tue, Mar 10, 2009 at 9:51 PM, Marijn Haverbeke wrote: >>> Ah, you are right. If the slot object has already been instantiated as >>> a regular slot, I don't know of any safe, portable way to make it a >>> column slot. If you can think of a hack to make this work, let me >>> know. But for now, you'll have to solve this in some other way. >>> >>> Best, >>> Marijn >>> >>> >>> On Tue, Mar 10, 2009 at 10:10 AM, Lucas Hope wrote: >>>> Hi Marijn, >>>> >>>> I stubbed out the form and the dao-circle was successfully compiled (of course). >>>> >>>> However the example circle I tried to make did not have its slot value >>>> set. ?I understand (I think) what you were trying to do with the >>>> *direct-column-slot* special variable, but maybe in this case (on >>>> Allegro CL, btw), ?while the effective-slot-definition-class works >>>> correctly (indicated by the correct CREATE TABLE below), ?the actual >>>> effective-column-slot object is instantiated OUTSIDE the scope of the >>>> binding in compute-effective-slot-definitio which sets >>>> *direct-column-slot* to non-nil. >>>> >>>> There's no reason for the lisp implementation to instantiate the class >>>> returned by effective-column-slot immediately, as far as I can tell. >>>> >>>> (dao-table-definition 'dao-circle) ;; success! >>>> "CREATE TABLE dao_circle (radius REAL NOT NULL)" >>>> >>>> (setf circle (make-instance 'dao-circle :radius 5.0)) >>>> >>>> (slot-boundp circle 'radius) >>>> => NIL ;; fail. :( >>>> >>>> -Luke >>>> >>>> On Tue, Mar 10, 2009 at 6:19 PM, Marijn Haverbeke wrote: >>>>> Hello Luke, >>>>> >>>>> I think (though I'm never entirely sure with this MOP stuff) that that >>>>> error is only there becuase I hadn't thought of the way you are trying >>>>> to use this metaclass, and assumed redefining a slot as a column was >>>>> always an accident. Could you try killing the WHEN-form on line 97 of >>>>> postmodern/table.lisp, doing what you're trying to do, and reporting >>>>> back whether it works as hoped? >>>>> >>>>> Best, >>>>> Marijn >>>>> >>>>> >>>>> On Tue, Mar 10, 2009 at 1:11 AM, Lucas Hope wrote: >>>>>> Hi there, >>>>>> >>>>>> I am just getting my feet wet with postmodern. ?It looks like I will >>>>>> be doing some heavy development with it for the next couple of weeks. >>>>>> Wish me luck! >>>>>> >>>>>> My (first?) issue is that I want to do something similar to the >>>>>> following example code. ?Here CIRCLE is an in-memory implementation of >>>>>> a circle, and it is desired to create a DAO object which moves storage >>>>>> to a postgres backend. (We have lots of circles...) >>>>>> >>>>>> Pretend CIRCLE has a host of useful functionality attached and I can't >>>>>> just point all the defmethods to DAO-CIRCLE. >>>>>> >>>>>> (defclass SHAPE () ()) >>>>>> >>>>>> (defclass CIRCLE (SHAPE) >>>>>> ?(radius)) >>>>>> >>>>>> (defclass DAO-CIRCLE (CIRCLE) >>>>>> ?((radius :col-type real)) >>>>>> ?(:metaclass dao-class)) >>>>>> >>>>>> (dao-table-definition 'dao-circle) >>>>>> => ERROR: Slot RADIUS in class # is both a >>>>>> column slot and a regular slot. >>>>>> >>>>>> Why doesn't this work, and how can I make it work? ?It seems like this >>>>>> is useful functionality to have. ?I want the DAO-CIRCLE's radius to be >>>>>> a column slot. >>>>>> >>>>>> Cheers, >>>>>> >>>>>> -Luke >> >> _______________________________________________ >> postmodern-devel mailing list >> postmodern-devel at common-lisp.net >> http://common-lisp.net/cgi-bin/mailman/listinfo/postmodern-devel >> > > _______________________________________________ > postmodern-devel mailing list > postmodern-devel at common-lisp.net > http://common-lisp.net/cgi-bin/mailman/listinfo/postmodern-devel > From lucas.r.hope at gmail.com Tue Mar 10 21:21:39 2009 From: lucas.r.hope at gmail.com (Lucas Hope) Date: Wed, 11 Mar 2009 08:21:39 +1100 Subject: [postmodern-devel] Bug when redefining a class. Message-ID: <69fb852b0903101421s4bd42202xdcd31f081966dbb9@mail.gmail.com> Hi again, The following triggers an incorrect error for me. Not a major bug since the third case provides a workaround. (defclass FOO () ((bar :col-type real)) (:metaclass dao-class) (:keys baz)) (dao-table-definition 'foo) ;; correct error. ;; redefine: (defclass FOO () ((bar :col-type real)) (:metaclass dao-class)) ;; incorrect error! ;; redefine: (defclass FOO () ((bar :col-type real)) (:metaclass dao-class) (:keys bar)) ;; works, then can run the second defclass successfully. -Luke From marijnh at gmail.com Wed Mar 11 08:39:02 2009 From: marijnh at gmail.com (Marijn Haverbeke) Date: Wed, 11 Mar 2009 09:39:02 +0100 Subject: [postmodern-devel] Bug when redefining a class. In-Reply-To: <69fb852b0903101421s4bd42202xdcd31f081966dbb9@mail.gmail.com> References: <69fb852b0903101421s4bd42202xdcd31f081966dbb9@mail.gmail.com> Message-ID: Hi, It appears that, when redefining a class, the class options that are not specified are left as they were in the old class, rather than reverting to their initform, as one would expect. All implementations seem to agree on this, so I'll assume it's standard behaviour. I've added a kludge to the metaclass' shared-initialise, which seems to solve this. Best, Marijn On Tue, Mar 10, 2009 at 10:21 PM, Lucas Hope wrote: > Hi again, > > The following triggers an incorrect error for me. Not a major bug > since the third case provides a workaround. > > (defclass FOO () > ?((bar :col-type real)) > ?(:metaclass dao-class) > ?(:keys baz)) > > (dao-table-definition 'foo) ;; correct error. > > ;; redefine: > (defclass FOO () > ?((bar :col-type real)) > ?(:metaclass dao-class)) > ;; incorrect error! > > ;; redefine: > (defclass FOO () > ?((bar :col-type real)) > ?(:metaclass dao-class) > ?(:keys bar)) > ;; works, then can run the second defclass successfully. > > -Luke > > _______________________________________________ > postmodern-devel mailing list > postmodern-devel at common-lisp.net > http://common-lisp.net/cgi-bin/mailman/listinfo/postmodern-devel > From lucas.r.hope at gmail.com Mon Mar 16 10:19:06 2009 From: lucas.r.hope at gmail.com (Lucas Hope) Date: Mon, 16 Mar 2009 21:19:06 +1100 Subject: No subject Message-ID: <69fb852b0903160319i48485626k3e900781f2da9029@mail.gmail.com>