<br><br><div><span class="gmail_quote">On 2/24/07, <b class="gmail_sendername">J J</b> &lt;<a href="mailto:azreal1977@hotmail.com">azreal1977@hotmail.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br><br>&gt;Usually though you&#39;d just use:<br>&gt;<br>&gt;a := Array new: 5.<br>&gt;<br>&gt;and add the Collections.Arrayed Namespace to your import list. Each import<br>&gt;list is common to all classes at a certain branch of the Namespace
<br>&gt;hierarchy, so the dotted notation is only useful if, in the same branch of<br>&gt;the Namespace hierarchy, you want to use two classes (or global vars) that<br>&gt;have the same name.<br><br>When you say &quot;global vars&quot; you mean classes right?
</blockquote><div><br>I&#39;ll answer this question in more detail below...</div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">And how does the import work?&nbsp;&nbsp;This is one thing I am concerned about:&nbsp;&nbsp;In
<br>python, your &quot;unit of work&quot; is a file.&nbsp;&nbsp;So you look at the top and see the<br>imports and you know they are valid for *this file&quot; (or if you import in a<br>local scope it extends to the end of that scope).&nbsp;&nbsp;In smalltalk the compiled
<br>&quot;unit of work&quot; is a method, no?&nbsp;&nbsp;My import/export list is going to have to<br>be in the class definition right?</blockquote><div><br>No - I&#39;ve designed it so that the import list is part of the current local Namespace and is shared by all classes at that level of nesting in that Namespace. Note that this design isn&#39;t final; I&#39;m going to see what pragmatically works best.
<br><br>A Namespace is a Dictionary and has a list of imports. It maps #Names to objects, and those objects would be predominantly classes but could be any object in the current image.<br><br>When your code is compiled, I&#39;ve changed it so that it searches for global variables first directly in that classes&#39; namespace, and then in that namespace&#39;s import list. If the name uses the dot notation (
e.g. #&#39;Collections.OrderedCollection&#39;) then it splits the name up first before searching. <br><br>An example: for #&#39;Collections.OrderedCollection&#39;, it would first search for #Collections in the local Namespace for the class you&#39;re working with. If it isn&#39;t there, it then searches in the import list of that Namespace. When it finds #Collections (which would be another Namespace) in the import list, it then looks up #OrderedCollection within the #Collections Namespace.
<br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">I know these are things that can be overcome with the tools (maybe show the<br>
fully qualified class on mouseover), but it is just something to think<br>about.&nbsp;&nbsp;Oh, and if a base class imports a bunch of stuff does a derived<br>class get it too, or do I have to specify the same imports over and over?&nbsp;&nbsp;I
<br>suppose you could have a default import (e.g. Core.*), package imports and<br>class imports.</blockquote><div><br>Erm... read the above. The imports of a base class have no effect on the imports of any subclasses. If they&#39;re in the same Namespace, they have the same import list. If they aren&#39;t, then they don&#39;t.
<br><br>There are no default imports or class imports. There&#39;s also no such thing as a package in my schema.<br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
&gt;I&#39;m not entirely sure how I&#39;d implement your message sending idea, and it<br>&gt;doesn&#39;t particularly feel &quot;right&quot; to me. I assume you mean:<br>&gt;<br>&gt;a := Collections Arrayed Array new: 5.<br>
&gt;<br>&gt;Michael.<br><br>No, actually my favorite so far was from (I believe) Gemstone.&nbsp;&nbsp;As I recall,<br>it was something like:<br><br>((Collections at: #Arrayed) at: #Array) new: 5.</blockquote><div>&nbsp;</div></div>Er... yuck.
<br><br>Michael.<br>