Squeak and Namespaces
stephane ducasse
stephane.ducasse at free.fr
Thu Nov 30 07:29:54 UTC 2006
On 30 nov. 06, at 05:00, Andreas Raab wrote:
> 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.
Ok I see.
Indeed this is close to what I was thinking. Inside your package you
do not have the idea that you may have imported from different
namespace.
you get a flat world. And you can decide to bind your symbols in the
import.
> 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.
Yes
>
> Cheers,
> - Andreas
>
>
>
More information about the Squeak-dev
mailing list
|