Re: [cedet-eieio] call-next-method invocation order
Brought to you by:
zappo
From: Jan M. <jan...@un...> - 2010-07-19 04:56:28
|
Hi Frank. > Fair enough!! > BTW c3 doesn't seem to be available in emacs 23.2.1 If you just wish to experiment, you could download eieio.el of the CEDET CVS version and load it into your current session. > Well I still puzzle how to apply the class option > :method-invocation-order properly. > > (1) Does it have to be defined for all classes in a tree; > > (2) or to the base class and the specified invocation order is then > effective for all child classes which inherit from it > > (3) or to the some class and if an object of this class is created then > the specified invocation order is effective as specified by this class? The method invocation order is determined by the class precedence list. When computing the class precedence list, the "starting point" class of the search process determines how the search process is carried out. In the context of invoking methods, the most specific class would be the "starting point". For MOP-based systems (unlike EIEIO) this means that the class-precedence-list method of the "starting point" class is called. In this case, that method (I make a slight simplification here) decides how the class precedence list is computed. In EIEIO, the class precedence list is also present and is computed based on the method-invocation-order of the "starting point" class. It is used in method invocation, together with other mechanisms. As a consequence of these other mechanisms, the method-invocation-orders of superclasses of the "starting point" class can influence method invocation. This behavior is not optimal (that's my impression), but it would required *a lot* of work to change it. Conclusion: In principle, only the "starting point" class matters. In today's EIEIO, superclasses may matter as well. Kind regards, Jan |