[Bese-devel] ucw special slots

Nathan Bird nathan at acceleration.net
Thu May 4 22:38:33 UTC 2006


I was playing around with the component-class.component-slots function a bit
more and the idea of declaring components slots with ":component T". The
goal is to be able to declare an unbound slot that is still listed as one of
the component-slots.  This doesn't quite work right now because it tries to
instantiate a class of type t, and fails.

 

Looking at the code, I can add a check into the initialize-component-slots
function that doesn't try to make an instance when that is the value for
type of component. But this is a bit odd because T is a type.

 

Alternatively we thought about using ":component nil" to indicate the same,
but this kind of appears to be saying I don't want it to be a component.
This does capture the idea of getting an unbound slot though.

 

Alternatively we could add to the standard-component-direct-slot a slot
named componentp or some such.

 

I'm leaning towards :component nil, and add a bit of documentation. Any
thoughts? Is this a bad idea for some other reason? Any better suggestions?
I don't actually have a component right now that I need to be able to do
that, but it seems like something I would want and I was working on a
child-components function which got me thinking about it.

 

Next to this, I am implementing a nice child-components function that will
give you the values of all the slots that are component-slots, and have
components in them.

 

Nathan Bird

 

 

  _____  

From: bese-devel-bounces at common-lisp.net
[mailto:bese-devel-bounces at common-lisp.net] On Behalf Of Nathan Bird
Sent: Wednesday, May 03, 2006 6:56 PM
To: bese-devel at common-lisp.net
Subject: [Bese-devel] ucw special slots

 

A standard component has a number of slots used by UCW for 'stuff'  i.e.
component.place, parent, calling-component.  When trying to do automatic
component rendering by rendering all of the slots, we have to filter out all
of the ucw ones, otherwise we end in rendering circles.  Is there some way
of determing whether it is a UCW information slot other than by checking its
name against a list?

 

The function component-class.component-slots is close, but that seems to
only give slots declared with the :component keyword, and an ordinary slot
on a component class is still made as an ordinary slot, even if it is later
filled with a component.  It looks like I can declare it with :component T,
to delay filling it but still make it a component slot. I think this will
meet all my needs.

 

Is there something that already does this that I haven't found yet? Am I
missing some better way?

 

Nathan

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/bese-devel/attachments/20060504/690a4ef1/attachment.html>


More information about the bese-devel mailing list