[Modules] Name space semantics was: Re: Some of my thoughts

Stephen Pair spair at advantive.com
Thu Aug 16 13:53:11 UTC 2001


> But where is your proposal different? As far as I can see you 
> do resolve the symbol #add: into different objects, namely 
> #42add: (or #56add: for that matter).

The difference is that "'add:' asSymbol" would always yield the same
object no matter which module you are in.  

Clearly, tool support would be critical to making it clear to the user
what is happening.  But, I can imagine the Browser working just as it
does today, but if you are in a project (that has a package associated
with it)...the browser would show the version of #add: for your
project...jumping to another project and opening the browser would
potentially reveal a different version of #add:.  The browser could be
enhanced to embolden everything that you've added to the system in a
given package (i.e. the class category, class, protocol, and methods
that you've modified in any way would show up in bold in the browser).
Seems pretty straightforward.  More sophisticated tools that don't
require you to jump between projects could be made available as well.

> And wouldn't it be 
> simpler to do something like implement #42add: as
> 
> Object>>42add: anObject
> 	^self 56add: anObject.
> Object>>56add: anObject
> 	^self add: anObject.

Actually, I don't think that is simple at all...a package that is made
dependent on yours, that uses the #add: method, would have to modify all
of its uses of #add: to #42add:...name clashes would be easy...all of
these weirdly named selectors would look bizarre, and the meaning behind
them would be difficult to discern by a new user...it is a heavy burden
for the developer (particularly a new user)...it is more difficult for
the system to determine dependencies (it would have to search for
packages that implement #42add: as opposed to knowing this directly).

Basically, what we're doing is adding an instance variable to Symbols in
the form of this index.  This "instance variable" points to the package
defining the symbol.

I'm not convinced by your position that it would be 1) too difficult or
impossible to implement, or 2) that it would make the system more
difficult to use (in fact, I think it would make the system considerably
easier to work with). 

- Stephen





More information about the Squeak-dev mailing list