From: Jimka
Subject: MOP and slot definition meta objects
Date: 
Message-ID: <1142767663.122095.149590@t31g2000cwb.googlegroups.com>
Does any one know the difference between an effective slot definition
meta object
and a direct slot definition meta object?  I know the semantic
difference is that the direct
ones are the ones mentioned by the defclass directly and the effective
ones are calculated
taking the direct slots of the class and class precedence list into
account.

But as far as i can tell they are both instances of the same meta
class.
AMOP mentions two functions make-direct-slot-definition and
make-effective-slot-definition
and i cannot figure how what they would do differently?

-jim

From: Juanjo
Subject: Re: MOP and slot definition meta objects
Date: 
Message-ID: <1142805369.018070.84730@g10g2000cwb.googlegroups.com>
Jimka schrieb:
> But as far as i can tell they are both instances of the same meta
> class.
> AMOP mentions two functions make-direct-slot-definition and
> make-effective-slot-definition
> and i cannot figure how what they would do differently?

Effective slot definitions have a slot called LOCATION, which contains
the actual location of the slot and which, in the case of allocation
:INSTANCE, can be used to access the content of the slot by means of
[funcallable-]standard-instance-access, one of the few low level
function in the MOP.

One can conceivably subclass the class of effective slots definitions
to add more information about a slot, or even to implement slots which
have different allocation strategies. Unfortunately The AMOP
specification does not provide much information about how to do this.

Juanjo
From: Pascal Costanza
Subject: Re: MOP and slot definition meta objects
Date: 
Message-ID: <485js7FiaitgU1@individual.net>
Jimka wrote:
> Does any one know the difference between an effective slot definition
> meta object
> and a direct slot definition meta object?  I know the semantic
> difference is that the direct
> ones are the ones mentioned by the defclass directly and the effective
> ones are calculated
> taking the direct slots of the class and class precedence list into
> account.
> 
> But as far as i can tell they are both instances of the same meta
> class.
> AMOP mentions two functions make-direct-slot-definition and
> make-effective-slot-definition
> and i cannot figure how what they would do differently?

The AMOP discusses different variations of a metaobject protocol for 
CLOS / a CLOS-like language. The functions make-direct-slot-definition / 
make-effective-slot-definition are from the main part of the book, but 
they do not exist in the actual CLOS MOP specification in Chapters 5 and 6.

In the CLOS MOP specification (those chapters), 
standard-direct-slot-definition and standard-effective-slot-definition 
are indeed different classes, with partially different slots. It's 
important to keep them separated, for example because the 
slot-xxx-using-class functions are specialized on effective slots, not 
on direct slots. If I remember correctly, the other MOPs in the book 
specialize on slot names, so it isn't that obvious what the role of 
effective slots is over there.


Pascal

-- 
3rd European Lisp Workshop
July 3-4 - Nantes, France - co-located with ECOOP 2006
http://lisp-ecoop06.bknr.net/