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

Jean-Claude Beaudoin jean.claude.beaudoin at gmail.com
Sat Aug 2 01:24:24 UTC 2014


Hello CL Pros,

Lately I have been trying to understand the inner workings of the MOP slot
protocol as I go through yet one more reading of the usual CLOS litterature
(CLHS, AMOP, OOP The CLOS Perspective).

To that end I put together a little test file (here attached) and ran its
code in sbcl, clisp, ccl, acl and lispworks.
I got different results in pretty much each CL implementation on the
tracing of calls to slot-value-using-class.

I am puzzled and baffled.

The results I see go like this:

sbcl:  only accessors (foo-a) call s-v-u-c.

clisp:  both accessors and cl:slot-value call s-v-u-c.

ccl:  s-v-u-c is called neither by cl:slot-value nor by accessors.

acl:  both accessors and cl:slot-value call s-v-u-c.

lispworks:  only cl:slot-value calls s-v-u-c.


Only clisp and acl seem to agree.

And the cherry on the cake's icing comes with sbcl when then defmethod on
s-v-u-c is moved ahead of the defclass/make-instance sequence.
Then, in sbcl, both accessors and cl::slot-value call s-v-u-c as in clisp
and acl.

So my question is: Which one is right?

Thank you for your help.

Jean-Claude Beaudoin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/pro/attachments/20140801/04ce25ae/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: slot_mop.lsp
Type: application/octet-stream
Size: 1764 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/pro/attachments/20140801/04ce25ae/attachment.obj>


More information about the pro mailing list