Article View: comp.lang.clos
Article #96Alternative specializer types
From: Trent Lange
Date: Tue, 08 Sep 1992 01:09
Date: Tue, 08 Sep 1992 01:09
36 lines
2275 bytes
2275 bytes
In an application I'm developing, it would be very useful to allow my methods to have specializers different than the standard class or eql specializers, but it's not clear whether the AMOP supports it. In particular, I would like to have a class of methods that can use "AND" specializers, as in: (defmethod foo ((self (and class1-mixin class2-mixin))) ...) I need this because class1-mixin and class2-mixin can be used independently of each other, but when used together require a completely different algorithm for foo. I could, of course, create a class1-and-class2-mixin class that inherits both and does what is necessary. However, I'm trying to design my class hierarchy so that users can build their classes out of whatever mixins they need, without having to worry about their potential interdependencies (e.g. knowing they have to include a class1-and-class2-mixin). From what I can tell, the AMOP basically mentions nothing at all about using these kind of alternative specializers. It seems like it *does* support it, or is close to supporting it, in that one would only have to specialize COMPUTE-APPLICABLE-METHODS and COMPUTE-APPLICABLE-METHODS-USING-CLASSES for the new method class to work with the new specializer type. My worry is that the specification of CLOS and the AMOP only mentions specializers as being class or eql specializers. In fact, the text for DEFMETHOD on p. 839 of Steele Vol. 2 explicitly says: "A parameter specializer name is a symbol that names a class or (eql eql-specializer-form)." Does this rule out what I want to do? I can easily make the change to support alternative specializers for the next version of July 92 PCL, but is it supported by the AMOP (and other implementations)? - Trent Lange lange@cs.ucla.edu
Technical Details
Message-ID:
<1992Sep8.010940.1582@cs.ucla.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!haven.umd.edu!darwin.sura.net!wupost!cs.utexas.edu!swrinde!elroy.jpl.nasa.gov!ucla-cs!lanai.cs.ucla.edu!langeShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!haven.umd.edu!darwin.sura.net!wupost!cs.utexas.edu!swrinde!elroy.jpl.nasa.gov!ucla-cs!lanai.cs.ucla.edu!lange From: lange@lanai.cs.ucla.edu (Trent Lange) Newsgroups: comp.lang.clos Subject: Alternative specializer types Message-ID: <1992Sep8.010940.1582@cs.ucla.edu> Date: 8 Sep 92 01:09:40 GMT Sender: usenet@cs.ucla.edu (Mr Usenet) Organization: UCLA Artificial Intelligence Laboratory Lines: 36 Nntp-Posting-Host: lanai.cs.ucla.edu