<div dir="ltr"><br><br><div class="gmail_quote">On Mon, Oct 13, 2008 at 1:20 PM, Craig Latta <span dir="ltr"><<a href="mailto:craig@netjam.org">craig@netjam.org</a>></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>
> Whoever said that the class variables of a metaclass should be those<br>
> of Metaclass is very wrong. Code compiled in the context of a<br>
> metaclass includes the class variables of the non-metaclass<br>
> (metaclass's instance), otherwise one couldn't access class variables<br>
> in class-side methods.<br>
<br></div>
I think you're confusing metalevels. If I compile a class-side method for Array, and I use a class variable, conceptually it's one of Array's class variables I'm using, yes? What the class variables of (Array class) might be is irrelevant. Yes, during compilation, Metaclass>>scopeHas:ifTrue: delegates to the receiver's sole instance, but that doesn'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 Foo, the compiler asks Foo class to lookup variables, not Foo. 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's inst vars. 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's class pool, not the compiler.</div>
<div><br></div><div>So it makes sense to me that Foo class's class pool is the same as Foo's.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
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't have access to it.</blockquote>
<div><br></div><div>The only place that instances of Metaclass have access to Metaclass's class pool is in methods on Metaclass. Class-side methods in metaclasses other than Metaclass class do _not_ have access to Metaclass class variables. 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>
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>