Marko Rauhamaa <ma...@pacujo.net> writes: > GOOPS also, surprisingly, seems to be decades behind in trying to > present objects as collections of slots. > > I once heard this story. The French king had a royal ball in honor of > the birthday of the French queen. When some lordly guests presented > their gift, a pair of fancy stockings, the king drew a fit, declaring: > "The Queen of France does not have legs!" > > Similarly, in my mind, objects don't have slots, they interact.
You are right. Slots are an implementation detail. Notice that you have them in all (common) OO systems. But the difference with CLOS, with the MOP, (I don't know if GOOPS implements the MOP, Meta Object Protocol), slots are reified as first class objects, and can be added or removed from a class (therefore, to all its instances). This allows you to forget slots as features of classes, but instead, as an implementation mechanism for certain kinds of relationships. So you can define a macro define-associations and use it to describe how your objects interrelate and interact with others, and this macro will add slots as needed to implement those associations: https://github.com/informatimago/abnotation/blob/master/src/core/model.lisp https://github.com/informatimago/lisp/blob/master/clext/association.lisp#L575 -- __Pascal Bourguignon__ http://www.informatimago.com/ “The factory of the future will have only two employees, a man and a dog. The man will be there to feed the dog. The dog will be there to keep the man from touching the equipment.” -- Carl Bass CEO Autodesk