<html><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
</head>
<body>
<p>Hey, I am a touch frustrated. Recovered with <49>. The code
I wrote to generate classes and methods has been corrupting my
image, or rather mucking to the changes. I was having old code
versions being loaded and breaking bad. I was publishing a lot of
garbage because when running the BoxOfKittens, I was generating
several SharedNears, now called Neighbors. This subclass
generation and the method compilation is being done it the
following methods...I am just going to leave it turned off for now
and stay focused on my objective. It is an example of corruption
occurring, if that helps anyone. If one could tell me how to
better generate these artifacts, that would be outstanding!•
</p>
<pre class="moz-signature" cols="72">•••
</pre>
<p></p>
<p>The #buildOnClass is called from a class creation method<br/>
</p>
<blockquote>
<p>buildOnClass: eClazz<br/>
<br/>
|refClass |<br/>
refClass := self stubClass<br/>
subclass: (eClazz name, 'Stub') asSymbol<br/>
instanceVariableNames: ''<br/>
classVariableNames: ''<br/>
poolDictionaries: ''<br/>
category: self userClassCategoryString.<br/>
<br/>
"Copy all methods, up to Object, to the new refClass, with
redirectMessage forwarding."<br/>
self copyMethodsToClass: refClass fromClass: eClazz
upToClass: Object.<br/>
<br/>
^ refClass <br/>
</p>
</blockquote>
<blockquote>
<pre class="moz-signature" cols="72">•••</pre>
</blockquote>
<blockquote>copyMethodsToClass: refClass fromClass: valueClazz
upToClass: rootClass<br/>
</blockquote>
<blockquote>
<p><br/>
| arguments classes newMethodString |<br/>
"Collect classes to contribute message protocol."<br/>
classes := valueClazz allSuperclasses select: [ :clazz |
(Object ~~ rootClass) and: [ Object inheritsFrom: clazz] ].<br/>
<br/>
"contribute message protocols."<br/>
classes do: [:thisClazz | <br/>
thisClazz methodDictionary keysAndValuesDo: [:selector
:method | <br/>
arguments := method tempNames first: method numArgs.<br/>
newMethodString := self buildForwardingMethod:
selector contents arguments: arguments.<br/>
Compiler <br/>
compile: newMethodString<br/>
environment: refClass environment <br/>
notifying: nil <br/>
trailer: method trailer <br/>
ifFail: [nil]]].<br/>
</p>
<pre class="moz-signature" cols="72">•••</pre>
buildForwardingMethod: selector arguments: arguments<br/>
<br/>
| argumentString selectorStream |<br/>
argumentString := ((arguments inject: ''writeStream into:
[:stream :argument | stream nextPutAll: argument, ' ']) contents).<br/>
selectorStream := '' writeStream.<br/>
(selector subStrings: $:) with: arguments do: [:keyword
:argument | selectorStream nextPutAll: keyword, ': ', argument, '
'].<br/>
^ selectorStream contents, '<br/>
<br/>
^self redirectMessage: (Message selector: ', selector
asSymbol printString, ' arguments: #{', argumentString, '}).'<br/>
</blockquote>
Alright then,<br/>
<pre class="moz-signature" cols="72">--
••• rabbit ❤️🔥🐰</pre>
</body></html>