<div dir="ltr"><br><br><div class="gmail_quote">On Mon, Oct 13, 2008 at 1:20 PM, Craig Latta <span dir="ltr">&lt;<a href="mailto:craig@netjam.org">craig@netjam.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
Hi Eliot--<div class="Ih2E3d"><br>
<br>
&gt; Whoever said that the class variables of a metaclass should be those<br>
&gt; of Metaclass is very wrong. Code compiled in the context of a<br>
&gt; metaclass includes the class variables of the non-metaclass<br>
&gt; (metaclass&#39;s instance), otherwise one couldn&#39;t access class variables<br>
&gt; in class-side methods.<br>
<br></div>
 &nbsp; &nbsp; I think you&#39;re confusing metalevels. If I compile a class-side method for Array, and I use a class variable, conceptually it&#39;s one of Array&#39;s class variables I&#39;m using, yes? What the class variables of (Array class) might be is irrelevant. Yes, during compilation, Metaclass&gt;&gt;scopeHas:ifTrue: delegates to the receiver&#39;s sole instance, but that doesn&#39;t mean that a metaclass has the same class variables as its sole instance.</blockquote>
<div><br></div><div>When compiling code in Foo class, as opposed to&nbsp;Foo, the compiler asks&nbsp;Foo&nbsp;class to lookup variables, not&nbsp;Foo. &nbsp;Hence if the code refers to a class inst var of Foo it will be in scope because this class inst var will be one of Foo class&#39;s inst vars. &nbsp;Similarly, when the compiler asks Foo class to bind a variable that is actually a class variable of Foo, it is up to Foo class to look in Foo&#39;s class pool, not the compiler.</div>
<div><br></div><div>So it makes sense to me that Foo class&#39;s class pool is the same as Foo&#39;s.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

 &nbsp; &nbsp; To say otherwise is to introduce a conceptual inconsistency into the system: the class variables of an object are defined by its class, except if that object is a metaclass. Further, suppose the class variables pool for Metaclass were not empty. By your logic instances of Metaclass don&#39;t have access to it.</blockquote>
<div><br></div><div>The only place that instances of Metaclass have access to Metaclass&#39;s class pool is in methods on Metaclass. &nbsp;Class-side methods in metaclasses other than Metaclass class do _not_ have access to Metaclass class variables. &nbsp;Try it :)</div>
<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><br>
<br>
 &nbsp; &nbsp; I guess we disagree here.<div><div></div><div class="Wj3C7c"><br>
<br>
<br>
-C<br>
<br>
--<br>
Craig Latta<br>
improvisational musical informaticist<br>
<a href="http://www.netjam.org" target="_blank">www.netjam.org</a><br>
Smalltalkers do: [:it | All with: Class, (And love: it)]<br>
<br>
<br>
</div></div></blockquote></div><br></div>