Ensuring class x is a superclass of class y

"Tim Bradshaw (as tfb at tfeb dot org)" <[email protected]>
Newsgroups gmane.lisp.lispworks.general
Message-ID <[email protected]>
This is a general CL question (although it's MOPpy and I need the answer to work in LW).

I have a metaclass, soa-class, which has some additional behaviour from standard-class.  There is a class, soa, which is an soa-class, but whose direct superclass is standard-object.  soa needs to be a superclass of any soa-class, except itself.

What I currently do is have methods on validate-superclass which will succeed if both classes are soa-classes, but will succeed if the superclass is a standard-class and the subclass is an soa-class only if the subclass is named soa.

This achieves what I want, but it also does something much stronger: if an soa-class has superclasses x, y, ... z then *all* of these must be soa-classes.  So I can't use mixin classes which are not themselves soa-classes.  That's stronger than I need or want.

What is the appropriate way to ensure that, in the above case, at least one of x, y ... z is an soa-class?  Is the superclass argument to validate-superclass finalized enough that I can check its precedence list?

--tim

(Sigh.  Every time I use the CLOS MOP I realise how lucky we are they didn't try to standardise it as part of CL: the language never would have been standardised if they had.  It's just made of jelly, and language standards made of jelly are not a good idea.  Although they can be nutritious.)



_______________________________________________
Lisp Hug - the mailing list for LispWorks users
[email protected]
http://www.lispworks.com/support/lisp-hug.html
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.