<div dir="ltr">Jean-Claude,<br><div><br></div><div>the basic point that the other, more knowledgeable responders made, was:  You cannot define a method on slot-value-using-class specializing on standard-class and expect the same behavior across implementations.  This is because standard-class may be used within the lisp implementation itself and/or be treated by the compiler differently to achieve better performance.  If you want to use slot-value-using-class, you need to define your own metaclass and specialize the methods on that.</div>

<div><br></div><div>-Hans</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-08-03 9:40 GMT+02:00 Jean-Claude Beaudoin <span dir="ltr"><<a href="mailto:jean.claude.beaudoin@gmail.com" target="_blank">jean.claude.beaudoin@gmail.com</a>></span>:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote"><div class="">On Sat, Aug 2, 2014 at 7:38 AM, Pascal Costanza <span dir="ltr"><<a href="mailto:pc@p-cos.net" target="_blank">pc@p-cos.net</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div><br>
On 2 Aug 2014, at 06:35, Jean-Claude Beaudoin <<a href="mailto:jean.claude.beaudoin@gmail.com" target="_blank">jean.claude.beaudoin@gmail.com</a>> wrote:<br>
<br>
> I think I found the subsection you refer to: AMOP  5.3.1 (pp. 142-144) "Implementation and User Specialization", which contains two sub-subsections with titles starting with "Restrictions on".<br>




> I will try to decipher those and their implications now that I have renewed motivation to do so.<br>
<br>
<br>
</div>There are similar restrictions defined in <a href="http://www.lispworks.com/documentation/HyperSpec/Body/11_abab.htm" target="_blank">http://www.lispworks.com/documentation/HyperSpec/Body/11_abab.htm</a> - bullet 19.<br>




<br></blockquote><div><br></div></div><div>I missed that one too. Thank you for pointing it out.<br><br></div><div>But after modifying my test code to take account of it I saw no difference in the results.<br></div><div>

It turns out that it is the last bullet of the sub-subsection "Restrictions on Portable Programs" that is the key factor in the issue I am interested in here (last bullet of page 144 in AMOP, or <a href="http://franz.com/support/documentation/current/doc/mop/concepts.html#portable" target="_blank">here</a> as pointed by Steve). It basically states that the defmethod on slot-value-using-class must happen before any call to make-instance on a class the method uses as a specializer. (And then goes on to motivate this definition order restriction).<br>


</div><div>If I modify my test code to comply with this rule (see slot_mop_strict.lsp here attached) then sbcl stops being the odd man out and behaves like clisp and ACL (which I think is the proper behavior).<br><br></div>


<div>Further, if I agree to stop tickling the system where it does not like to be tickled and define a class tracked_class as a subclass of standard-class to be used as a metaclass of the classes I want to track (see slot_mop_strict_tracked_class.lsp here attached), then all of sbcl, clisp, ccl and ACL show the same behavior, properly calling slot-value-using-class both from slot-value or from the slot accessor. Only LispWorks persists in its (erroneous, I think) behavior of calling s-v-u-c only from slot-value.<br>


</div><div>I think there is a consensus emerging here.<br><br></div><div>Thank you all for your help on this matter with a special emphasis toward Steve.<br><br></div><div><br><br><br>
</div></div></div></div>
<br>_______________________________________________<br>
pro mailing list<br>
<a href="mailto:pro@common-lisp.net">pro@common-lisp.net</a><br>
<a href="http://common-lisp.net/cgi-bin/mailman/listinfo/pro" target="_blank">http://common-lisp.net/cgi-bin/mailman/listinfo/pro</a><br>
<br></blockquote></div><br></div>