From pmai@acm.org Wed Dec 08 21:21:50 1999 Path: news.mclink.it!news.caspur.it!serra.unipi.it!newsfeed.cineca.it!newsfeed.nettuno.it!news-MUC.ecrc.net!news-raspail.gip.net!news.gsl.net!gip.net!newsfeed.tli.de!news-fra.pop.de!informatik.uni-bremen.de!cs.tu-berlin.de!dent.isdn.cs.tu-berlin.de!not-for-mail From: pmai@acm.org (Pierre R. Mai) Newsgroups: comp.lang.lisp Subject: Re: MOP/pcl anomaly in CMUCL? Date: 08 Dec 1999 21:21:50 +0100 Organization: Technical University Berlin, Germany Lines: 47 Message-ID: <87ln759o9t.fsf@orion.dent.isdn.cs.tu-berlin.de> References: NNTP-Posting-Host: dent.isdn.cs.tu-berlin.de Mime-Version: 1.0 (generated by tm-edit 7.108) Content-Type: text/plain; charset=US-ASCII X-Trace: news.cs.tu-berlin.de 944705784 29456 130.149.223.160 (9 Dec 1999 02:16:24 GMT) X-Complaints-To: news@cs.tu-berlin.de NNTP-Posting-Date: 9 Dec 1999 02:16:24 GMT X-Server-Date: 8 Dec 1999 20:21:51 GMT X-Face: /*3I*tn$ZTJ]<2&dd0'RP/bd4u}"hA=q"H{Q_:5(D)`OOV4` writes: > In an attempt to backport some code from scheme (guile/goops) I tried > to make a simple test, taken from AMOP (the dynamic slots example). When using the MOP of CMUCL/PCL you have to take into account a number of issues (in other implementations, you have to take into account other sets of issues, which makes portable MOP programming less enjoyable than it could be. I hope that current and future efforts of the standardization committees will improve that situation ;): * Make sure that you use the right symbols: A number of symbols (like e.g. standard-class) exist in two variants, one in the COMMON-LISP package, and one in the PCL package. For MOP programming you usually need the ones in PCL. * Take a look at the MOP package, which exports most (but not all) of the symbols defined in AMOP. * Since CMUCL uses special wrappers around class-objects, you sometimes need to use pcl::coerce-to-pcl-class to coerce those wrappers into the real PCL/MOP class objects (e.g. when using class-of). * It's neccessary to define methods on pcl:validate-superclass more often than is mentioned in AMOP. The last issue will probably lie at the heart of your problem: Since test (whose metaclass is dynamic-slots-class) inherits from t (whose metaclass is standard-class), you have to define this combination valid: (defmethod pcl:validate-superclass ((class dynamic-slots-class) (super pcl:standard-class)) t) > I was trying to do the following: > > (defclass dynamic-slots-class (standard-class) ()) > (defclass test () ((a1)) (:metaclass dynamic-slots-class)) Regs, Pierre. -- Pierre Mai PGP and GPG keys at your nearest Keyserver "One smaller motivation which, in part, stems from altruism is Microsoft- bashing." [Microsoft memo, see http://www.opensource.org/halloween1.html]