A little namespace "proposal"

goran.krampe at bluefish.se goran.krampe at bluefish.se
Thu Apr 15 13:01:35 UTC 2004


=?ISO-8859-1?Q?st=E9phane_ducasse?= <ducasse at iam.unibe.ch> wrote:
> hi
[SNIP]
> > Which will create a new Namespace instance with a name instvar holding
> > #Tweak and it will also put that instance in Smalltalk. But I would
> > typically not do that, instead I would just do this (yes, works fine):
> >
> > Object subclass: #Apple
> > 	instanceVariableNames: ''
> > 	classVariableNames: ''
> > 	poolDictionaries: ''
> > 	category: 'Tweak'
> > 	namespace: 'Tweak'
> 
> I don't like the namespace import at the class level. We will have to 
> type that all the time.

You are misunderstanding, the namespace above is the namespace that the
class Apple should be IN - it is NOT an import.
I repeat - my proposal HAS NO IMPORTS.

Sidenote: I have dropped the above class creation template and use now
instead simply qualified names like this:

	Object subclass: #Trees::Oak
		instanceVariableNames: ''
		classVariableNames: ''
		poolDictionaries: ''
		category: 'Trees'

When you create a class like this you automatically get a new Namespace
for it so that:

	(Trees at: #Oak) == (Smalltalk at: #Trees::Oak)

Code coming soon - it ALL WORKS right now, but I am polishing it a bit.

regards, Göran

PS. Yes, Bert, Andreas and Avi - I backed down and have now virtualized
the Namespace instances instead. Much, much simpler of course - and in
fact it is now "ready". I am just finishing up some comments and
tweaking it. Will post it during the day.



More information about the Squeak-dev mailing list