<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Hi Facu,</p>
<p>I haven't looked at the code, but perhaps #superclass: is a
low-level method that just does that one change. </p>
<p>A higher-level facility might want to change the superclass in
both the class and the metaclass, but it can't do that in one
method because of encapsulation -- one method can't change the
superclass instance variable in two different objects. So what
message would it send to each of the class and the superclass? One
logical selector to choose for that would be #superclass:.</p>
<p>Regards,</p>
<p>-Martin</p>
<div class="moz-cite-prefix">On 11/27/25 12:42 PM, Facundo Javier
Gelatti via Cuis-dev wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAC1UKnY7hxvRbzERJUNrcxhFp-K+UiNLbaUL=j8f=7UArTV+EQ@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr">
<div>Hi!<br>
<br>
</div>
I've noticed that the #superclass: message does not affect the
superclass of the (meta)class of the receiver. For example:<br>
<br>
<span style="font-family:monospace">Object subclass: #A
instanceVariableNames: '' classVariableNames: ''
poolDictionaries: ''.<br>
Object subclass: #B instanceVariableNames: ''
classVariableNames: '' poolDictionaries: ''.<br>
<br>
B superclass. " => Object "<br>
B class superclass. " => Object class "<br>
<br>
B superclass: A.<br>
<br>
B superclass. " => A "<br>
</span>
<div><span style="font-family:monospace">B class superclass. "
=> Object class (not A class)"</span></div>
<div><br>
</div>
<div>The Class>>#superclass: method has a comment that
says "Not to be used lightly!", so I'm not sure if this is in
fact the expected behavior (but at least I was surprised by
it).<br>
<br>
</div>
<div>Cheers!<br>
</div>
<div>Facu</div>
</div>
<br>
<fieldset class="moz-mime-attachment-header"></fieldset>
</blockquote>
</body>
</html>