A little namespace "proposal"

Avi Bryant avi at beta4.com
Wed Apr 7 09:29:51 UTC 2004


On Apr 7, 2004, at 2:50 AM, goran.krampe at bluefish.se wrote:

> So, Andreas could use a Preference which only render local names in
> short-form, and only accepts those names in short form. He could also
> introduce some global "import list" that is used to allow additional
> short names from certain namespaces etc, like from Morphic, but not 
> from
> MVC.

So, Andreas was talking about a "context" in which short names would be 
available for some classes: for example, Switch would be available 
unqualified in MVC but not in Morphic.  So far, we (or I, anyway) have 
been assuming this context was provided by the namespace of the class 
you're editing, plus explicit imports into that namespace.  What you're 
saying is that this same "context" is provided instead by the tools: 
you might define "imported" names per-browser, per-project, per-image, 
etc.  The compiler would have to be given this context explicitly, 
since it couldn't be inferred from, eg, the class you're compiling a 
method in.  As you wrote before, the names would be stored in the 
source fully qualified; the context would only be used to decide how to 
accept names and how to display them.

This is actually very much in line with a comment Andreas made about 
wanting to switch namespaces when you went into an MVC project vs. a 
Morphic one.  I like it, a lot.  I just want to see that 
dynamically-rewriting code pane working...

Avi




More information about the Squeak-dev mailing list