<br><br><div><span class="gmail_quote">On 9/19/07, <b class="gmail_sendername">Göran Krampe</b> &lt;<a href="mailto:goran@krampe.se">goran@krampe.se</a>&gt; wrote:</span><br><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
At this point people may be confused but it all boils down to this usage<br>pattern:<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- If you want to have a class Apple in your own namespace &quot;Fruit&quot;, just<br>name it &quot;Fruit::Apple&quot;! It is that simple.
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- If you want to move it, just rename it! The Namespace instances I<br>describe are automatically created and maintained.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- If you want to use it, just type &quot;Fruit::Apple&quot; (because hey, that is
<br>the name of the class!) but of course, you don&#39;t want to type all that so<br>fine, just type &quot;Apple&quot; and it will automatically work! Different things<br>will happen then:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- If there is no other Apple in your image it will just work. Apple. No
<br>prefix needed. This covers 98% I guess.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- If there are multiple Apple, Squeak will ask you which one you mean<br>(nice popup menu) and autoexpand it in place!<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- If there are multiple Apple BUT one of them is in your LOCAL namespace
<br>(=the namespace of the class you are editing) then it will work just<br>fine with the short form, the local Apple is chosen instead of the<br>others. This covers perhaps 70% of those last 2%. :)</blockquote><div><br><br>
This is more or less how you&#39;d interact with my tools too, except that half the steps won&#39;t work yet :-).<br></div><br></div>My thoughts on your proposal, which I&#39;m trying to keep technical rather than judgemental:
<br><br>* It&#39;s a one-way street to adopt your proposal. I assume that file-outs and changesets will have all names contain &quot;::&quot;. This means that any non-namespaced image can&#39;t use these file-outs, changesets etc.
<br><br>* I assume that operations you perform on your namespaces such as renaming them will involve the tools modifying the source code for every method that uses that namespace? This isn&#39;t exactly elegant.<br><br>* I also assume that to resolve conflicts of the namespace names themselves, the tools need to give the namespace a completely new name (which changes the source code as it&#39;s filed in), and to do this you&#39;d need input from the user?
<br><br>* If non-namespaced code is loaded into the image, the user will need to manually resolve all ambiguous names, of which there will be more of because developers don&#39;t need to use class name prefixes any more. 
<br><br>* Your proposal still involves the use of a global dictionary containing all global variables and classes. In computer science we learn that the use of global variables should be minimised, and your proposal certainly doesn&#39;t help us in this regard.
<br><br>* Your proposal doesn&#39;t completely solve naming collisions but instead reduce the likelihood of a collision happening. Collisions can still happen, and we still need to collaborate among ourselves to make sure two people don&#39;t use the same namespace.
<br><br>In effect, what you&#39;re presenting as a namespaces implementation for Squeak is a way to hide class name prefixes from the developer, with a well-defined prefix format. It doesn&#39;t provide code with a particular context to resolve names in, but rather asks the user on a name-by-name basis to resolve ambiguity.
<br><br>I&#39;m not against your proposal, and it doesn&#39;t make the situation any worse than the current situation except for the filing out issue.<br><br>So +0 from me :-). I&#39;d just like to ask you to put an easily-findable comment in the core parts of Squeak you change so that it is possible to remove it.
<br><br>Gulik.<br>