On Thu, May 1, 2008 at 7:30 PM, Robert Brown <<a href="mailto:brown@google.com">brown@google.com</a>> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d">The call to ensure-class without<br>
<br>
</div> :metaclass 'py-core-type<br>
<br>
succeeds.<br>
<br>
The call with the :metaclass argument fails inside change-class:<br>
<br>
(defmethod change-class ((instance standard-object) (new-class standard-class)<br>
&rest initargs)<br>
(unless (class-finalized-p new-class)<br>
(finalize-inheritance new-class))<br>
(let ((cpl (class-precedence-list new-class)))<br>
(dolist (class cpl)<br>
(macrolet<br>
((frob (class-name)<br>
`(when (eq class (find-class ',class-name))<br>
(error 'metaobject-initialization-violation<br>
:format-control "~@<Cannot ~S objects into ~S<br>
metaobjects.~@:>"<br>
:format-arguments (list 'change-class ',class-name)<br>
:references (list '(:amop :initialization ,class-name))))))<br>
(frob class)<br>
(frob generic-function)<br>
(frob method)<br>
(frob slot-definition))))<br>
(change-class-internal instance new-class initargs))<br>
<br>
CLASS is on the class precedence list of PY-CORE-TYPE.<br>
</blockquote><div><br>Thanks, I'm going to look into this.<br><br>- Willem<br><br></div></div>