<div dir="ltr"><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div>Hello CL Pros,<br><br></div>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).<br>
<br></div>To that end I put together a little test file (here attached) and ran its code in sbcl, clisp, ccl, acl and lispworks.<br></div>I got different results in pretty much each CL implementation on the tracing of calls to slot-value-using-class.<br>
<br></div>I am puzzled and baffled.<br><br></div>The results I see go like this:<br><br></div>sbcl:  only accessors (foo-a) call s-v-u-c.<br><br></div>clisp:  both accessors and cl:slot-value call s-v-u-c.<br><br></div>ccl:  s-v-u-c is called neither by cl:slot-value nor by accessors.<br>
<br></div>acl:  both accessors and cl:slot-value call s-v-u-c.<br><br></div>lispworks:  only cl:slot-value calls s-v-u-c.<br><br></div><br></div>Only clisp and acl seem to agree.<br><br></div>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.<br>
</div>Then, in sbcl, both accessors and cl::slot-value call s-v-u-c as in clisp and acl.<br><br></div>So my question is: Which one is right?<br><br></div>Thank you for your help.<br><br></div>Jean-Claude Beaudoin<br><br></div>