[pro] AMOP question: When and where is slot-value-using-class called?

Pascal Costanza pc at p-cos.net
Mon Aug 4 11:28:49 UTC 2014


On 4 Aug 2014, at 10:44, Jean-Claude Beaudoin <jean.claude.beaudoin at gmail.com> wrote:

> 
> On Sun, Aug 3, 2014 at 12:50 PM, Pascal Costanza <pc at p-cos.net> wrote:
> 
> - One reason why the change from slot name to slot definition metaobject was made is that it allows for better optimization of standard slot accesses that don’t need to go through user-defined methods on s-v-u-c and friends. In LispWorks, you need one extra step to invoke user-defined methods - you have to specify that slot access should not be optimized. In your example, the class definition for ‘foo should look like this to achieve this:
> 
> (defclass foo ()
>   ((a :accessor foo-a :initarg :a)
>    (b :accessor foo-b :initarg :b))
>   (:metaclass tracked-class)
>   (:optimize-slot-access nil))
> 
> 
> I see.  And are you cool with the pervasive opt-out nature of this :optimize-slot-access option?
> Looks pretty much like a quite clear rejection of the MOP slot protocol to me.

It’s a trade off, speed vs flexibility. It doesn’t really restrict you in any way, because you can always opt in. So I think it’s perfectly ok. If you don’t like it, there is Closer to MOP, which leaves optimize-slot-access at t when it can, but sets it to nil if necessary, so you don’t really have to worry that much.

> Personally, I don’t believe that forward-referenced-class or ensure-class-using-class are the most important areas that need fixing. There are other issues that are more relevant.
> 
> Quite of a cliffhanger you've done here!  Are we going to be treated with a sequel on the very subject of those issues?


Maybe. ;)

Pascal

--
Pascal Costanza
The views expressed in this email are my own, and not those of my employer.



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/pro/attachments/20140804/e0e1c102/attachment.html>


More information about the pro mailing list