[Openmcl-devel] [off-topic] Adding a slot to a class using the MOP

Pascal Costanza pc at p-cos.net
Mon Apr 22 13:23:58 PDT 2013


Check out AspectL, it provides exactly what you want.

However, it's also worthwhile spending some time on thinking about whether there is a better design for your problem. Adding slots like this creates a lot of problems. Maybe a typical hash table based meta class already provides what you need...

Pascal

Sent from my iPad

On 22 Apr 2013, at 19:32, Ron Garret <ron at flownet.com> wrote:

> Apologies for the non-CCL-related question, but c.l.l. is slow today and I'm really stuck on this.
> 
> I need to dynamically add a slot to a class using the MOP.  There doesn't seem to be a standard add-slot method, so I figure I need to use something like ensure-class.  To do that, I need to reconstruct the argument to :direct-slots from the existing class definition so I can add a slot without disturbing the existing slots.  Before I went down this rabbit hole I thought I'd ask: is there a better/easier way to do this?  Surely I'm not the first person to want to do this.
> 
> Many thanks,
> rg
> 
> _______________________________________________
> Openmcl-devel mailing list
> Openmcl-devel at clozure.com
> http://clozure.com/mailman/listinfo/openmcl-devel



More information about the Openmcl-devel mailing list