<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>In addition to Martin's very good answer, I'll add a Cuis
specific detail.</p>
<p>Regular classes are created by sending a message to the
superclass-to-be. The problem is how to create subclasses of nil.
In Cuis this is done in a rather hacky way:</p>
<p>ProtoObject subclass: #ProtoObject<br>
instanceVariableNames: ''<br>
classVariableNames: ''<br>
poolDictionaries: ''<br>
category: 'Kernel-Objects'.<br>
ProtoObject superclass: nil</p>
<p>So first the class is created as subclass of something else and
then the superclass is set to nil. However, ProtoObject class
superclass is Class. And this trick shows in ClassDescription
>> #definition. The reason for not simply sending
#subclass:instanceVariableNames:classVariableNames:poolDictionaries:category:
to nil (as it ised to be before we implemented this) is that a a
missing class in a file-in would result in classes with unexpected
nil superclass, instead of an error message.</p>
<p>I guess this all could be done in a clearer way. And this kind of
hack is the only reason for #superclass:</p>
<p>HTH,</p>
<div class="moz-cite-prefix">On 2025-11-27 5: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>
<pre class="moz-signature" cols="72">--
Juan Vuletich
<a class="moz-txt-link-abbreviated" href="http://www.cuis.st">www.cuis.st</a>
github.com/jvuletich
researchgate.net/profile/Juan-Vuletich
independent.academia.edu/JuanVuletich
patents.justia.com/inventor/juan-manuel-vuletich</pre>
</body>
</html>