<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; ">OK, I have done a few quick checks in the various CLOS implementations, and clisp, ecl, MCL and LispWorks have problems with one way or the other.<DIV><BR class="khtml-block-placeholder"></DIV><DIV>Here is a dirty workaround that should work on all systems, though:</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>(loop for class in direct-superclasses</DIV><DIV> thereis (ignore-errors (subtypep class (find-class 'my-object))))</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>This should get your code working.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>I will add more detailed checks on forward-referenced-class to the MOP Feature Tests and then proceed by either submitting bug reports and/or trying to fix things in Closer to MOP. This will take a while, though.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Cheers,</DIV><DIV>Pascal</DIV><DIV><BR><DIV><DIV>On 1 Nov 2006, at 00:58, Attila Lendvai wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite"><DIV><BLOCKQUOTE class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><DIV style=""><BR><DIV>(defmethod initialize-instance :around</DIV><DIV> ((class my-class) &rest initargs </DIV><DIV> &key direct-superclasses)</DIV><DIV> (declare (dynamic-extent initargs))</DIV><DIV> (if (loop for class in direct-superclasses</DIV><DIV> thereis (subtypep class (find-class 'my-object)))</DIV> </DIV></BLOCKQUOTE><DIV><BR>hm, this subtypep check errors on clisp when class is a forward referenced class.<BR> <BR>i could overcome it by (and (class-finalized-p ...)...) but that doesn't feel right. (looking at the clisp backend in closer-mop i couldn't find anything related). <BR><BR><BLOCKQUOTE style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;" class="gmail_quote">This idiom doesn't work in some CLOS implementations, but when you use Closer to MOP, the respective problems are fixed, so you can use this idiom in all implementations that Closer to MOP supports.</BLOCKQUOTE><BR>what do you mean by "when you use Closer to MOP"? i looked around in the sources but couldn't find anything related. it's not an important issue, i'm fine with sbcl, but as an opensource lib it's not nice to be tied to implementations.<BR><BR></DIV> </DIV>-- <BR>- attila<BR><BR>"- The truth is that I've been too considerate, and so became unintentionally cruel...<BR> - I understand.<BR> - No, you don't understand! We don't speak the same language!"<BR>(Ingmar Bergman - Smultronstället)</BLOCKQUOTE></DIV><BR><DIV> <SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><DIV>-- </DIV><DIV>Pascal Costanza, <A href="mailto:pc@p-cos.net">mailto:pc@p-cos.net</A>, <A href="http://p-cos.net">http://p-cos.net</A></DIV><DIV>Vrije Universiteit Brussel, Programming Technology Lab</DIV><DIV>Pleinlaan 2, B-1050 Brussel, Belgium</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><BR class="khtml-block-placeholder"></DIV><BR class="Apple-interchange-newline"></SPAN> </DIV><BR></DIV></BODY></HTML>