Sorry I wasn't clear. In python (afaik) the "compilation unit" is the scope, and in smalltalk the scope is the method. I guess categories as the scope could make sense. Would you have a context menu on the category for what imports you want for this scope, or how did you envision that?
From: Andreas Raab andreas.raab@gmx.de Reply-To: The general-purpose Squeak developers listsqueak-dev@lists.squeakfoundation.org To: The general-purpose Squeak developers listsqueak-dev@lists.squeakfoundation.org Subject: Re: Squeak and Namespaces Date: Wed, 29 Nov 2006 22:31:01 -0800
J J wrote:
You bring up good points, but how would you implement something like this in smalltalk? A "compilation unit" (and thus a lookup context) in python is a file. A "compilation unit" in smalltalk is a method.
Sure, but this is not about a "compilation unit" it's about a scope. Such a scope can easily be defined, system categories or Monticello packages are good candidates.
Cheers,
- Andreas
From: Andreas Raab andreas.raab@gmx.de Reply-To: The general-purpose Squeak developers listsqueak-dev@lists.squeakfoundation.org To: The general-purpose Squeak developers listsqueak-dev@lists.squeakfoundation.org Subject: Re: Squeak and Namespaces Date: Wed, 29 Nov 2006 20:00:26 -0800
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
Talk now to your Hotmail contacts with Windows Live Messenger. http://clk.atdmt.com/MSN/go/msnnkwme0020000001msn/direct/01/?href=http://get...
_________________________________________________________________ Fixing up the home? Live Search can help http://imagine-windowslive.com/search/kits/default.aspx?kit=improve&loca...