[postmodern-devel] Can't redefine slots as columns - why?

Marijn Haverbeke marijnh at gmail.com
Tue Mar 10 07:19:08 UTC 2009


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 <lucas.r.hope at gmail.com> 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 #<DAO-CLASS DAO-CIRCLE> 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
>




More information about the postmodern-devel mailing list