Squeak and Namespaces

Andreas Raab andreas.raab at gmx.de
Thu Nov 30 04:00:26 UTC 2006


stephane ducasse wrote:
>> And, I think imports are critical for scalability - because they a) 
>> declare dependencies explicitly and b) allow the *user* of a 
>> package/global to decide under which name to use them. The Python 
>> module system works that way and it works great.
> 
> Can you give an example? Do you mean that you can alias them?

No, I mean that a user can decide what's important for him and where to 
qualify and where not. For example, consider that both Tweak and Morphic 
define a class named Button. In Goran's proposal it means that you 
always have to qualify Button everywhere you see it; even in the innards 
of Morphic and Tweak where there is not the slightest chance of it 
meaning anything but what is reasonable in this context. In Python's 
module system you could (in the scope you are working in; usually a 
file) decide to either use only Tweak (and not qualify) or use only 
Morphic (and not qualify) or use Tweak qualified and Morphic 
unqualified, or vice versa, or use both qualified.

In either case it puts the user in control about what is important for 
him in the context he is working in instead of the system making 
requirements about qualifications of names because in some distant 
corner of the world a name has been used.

Cheers,
   - Andreas




More information about the Squeak-dev mailing list