<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hi,<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On 22 Dec 2017, at 11:49, Didier Verna <<a href="mailto:didier@lrde.epita.fr" class="">didier@lrde.epita.fr</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class=""><br class=""> Hi,<br class=""><br class="">Computing an effective method depends on the generic function's method<br class="">combination. But is it also the case for computing the discriminating<br class="">function?<br class=""><br class="">I don't see why it should in theory, but evidence seems to suggest<br class="">otherwise[1]. Maybe it does for technical reasons?<br class=""></div></div></blockquote><div><br class=""></div>Unfortunately, method combinations didn’t get a lot of love in AMOP, which means there is not a lot you can really do in a portable way.<br class=""><br class=""></div><div>The discriminating function calls compute-effictive-method to determine the effective method, but is allowed to cache the results of compute-effective-method. So the only reliable portable way to ensure that new effective methods are computed is by calling add-method, remove-method, initialize-instance, or reinitialize-instance. (See the AMOP entry for compute-discriminating-function.)</div><div><br class=""></div><div>This normally should mean that the most straightforward way to install a new method combination is by calling (reinitialize-instance gf :method-combination mc) - except that it’s not clear what the argument to :method-combination is supposed to look like. (It’s apparently meant to be the result of find-method-combination, except that it’s not clear what the arguments to find-method-combination should look like, especially the method combination options.)</div><div><br class=""></div><div>ensure-generic-function doesn’t help either. (According to AMOP: “The handling of the :method-combination option is not specified.”)</div><div><br class=""></div><div>So the next best option is (eval `(defgeneric …)) :-}</div><div><br class=""></div><div>I’m not aware of a portable way to flush caches directly in CLOS. (Some subclasses of generic-function may not even have caches…)</div><div><br class=""></div><div>Pascal</div><br class=""><div class="">
<span style="font-family: Menlo-Regular; font-size: 11px;" class="">--</span><br style="font-family: Menlo-Regular; font-size: 11px;" class=""><span style="font-family: Menlo-Regular; font-size: 11px;" class="">Pascal Costanza</span><br style="font-family: Menlo-Regular; font-size: 11px;" class=""><br class="">
</div>
<br class=""></body></html>