[closer-devel] interesting contextl use-case

Attila Lendvai attila.lendvai at gmail.com
Tue Jun 12 09:36:57 UTC 2007


hi!

we would like to add new slots to a class when being inside a layer.
the need comes when running some algorithm to calculate some new
properties of some instances. the usual solution is to set up a
hashtable, and add the extra property value in that hashtable.

what we would like to do is to define new slots for a class but only
in a given layer. so make-instance'ing that class when the layer is
active should return instances with the extra slots.

i'm not sure if this is already possible, but a possible
implementation would be to delegate make-instance to
make-layered-instance or make-instance-using-layer, then consult the
layer context and as needed return an unnamed subclass of the actual
class that contains the extra slots.

thoughts?

-- 
 attila



More information about the closer-devel mailing list