<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><BR><DIV><DIV>On 31 Oct 2006, at 22:24, Attila Lendvai wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite"><BR>hi!<BR><BR>i've updated <A href="http://common-lisp.net/project/computed-class/">computed-class</A> with custom generated accessors and in the process on making it more standard compliant i was looking for <A href="http://www.google.com/codesearch?hl=en&lr=&q=lang%253Alisp+initialize-class-metaobject&btnG=Search"> this</A> (#:<B class="hl">initialize-class-metaobject</B> #:re<B class="hl">initialize-class-metaobject</B>) piece of code that was once in aspectl but i can't find it anywhere. where are they?<BR><BR class="khtml-block-placeholder"></BLOCKQUOTE><BR></DIV><DIV>They are gone. (Well that's kind of obvious... ;)</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>They are gone for a reason: They were too complicated and achieved very little. I didn't completely understand the effects of forward-referenced-class at that time when I have written them and overestimated their potential bad effects on class initialization / reinitialization.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>The standard idiom for class initialization / reinitialization when you want to add your own default topmost object (like standard-object and funcallable-standard-object for standard-class and funcallable-standard-class) is this:</DIV><DIV><BR class="khtml-block-placeholder"></DIV><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><BR class="khtml-block-placeholder"></DIV><DIV>     ;; 'my-object is already one of the (indirect) superclasses</DIV><DIV>     (call-next-method)</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>     ;; 'my-object is not one of the superclasses, so we have to add it</DIV><DIV>     (apply #'call-next-method</DIV><DIV>            class</DIV><DIV>            :direct-superclasses</DIV><DIV>            (append direct-superclasses</DIV><DIV>                    (list (find-class 'my-object)))</DIV><DIV>            initargs)))</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>(defmethod reinitialize-instance :around</DIV><DIV>  ((class my-class) &rest initargs</DIV><DIV>   &key (direct-superclasses '() direct-superclasses-p))</DIV><DIV>  (declare (dynamic-extent initargs))</DIV><DIV>  (if direct-superclasses-p</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>    ;; if direct superclasses are explicitly passed</DIV><DIV>    ;; this is exactly like above</DIV><DIV>    (if (loop for class in direct-superclasses</DIV><DIV>              thereis (subtypep class (find-class 'my-object)))</DIV><DIV>       (call-next-method)</DIV><DIV>       (apply #'call-next-method</DIV><DIV>              class</DIV><DIV>              :direct-superclasses</DIV><DIV>              (append direct-superclasses</DIV><DIV>                      (list (find-class 'my-object)))</DIV><DIV>              initargs))</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>    ;; if direct superclasses are not explicitly passed</DIV><DIV>    ;; we _must_ not change anything</DIV><DIV>    (call-next-method)))</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>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.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>I hope this helps.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Pascal</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></BODY></HTML>