[GOODIE] Namespaces-gk
goran.krampe at bluefish.se
goran.krampe at bluefish.se
Fri Apr 16 09:58:59 UTC 2004
Bert Freudenberg <bert at impara.de> wrote:
> Am 15.04.2004 um 20:57 schrieb Avi Bryant:
>
> > On Apr 15, 2004, at 6:13 AM, goran.krampe at bluefish.se wrote:
> >
> >> IMHO it is pretty damn hard to make it any simpler than this.
> >
> > So, looking through the code, one thing that strikes me as overly
> > complicated is all the various modifications around renaming.
>
> Yep, and I think we can do still simpler in other places, too.
Yes, I agree - I was more referring to the actual "scheme" of it all.
Not the code!
> For example: How about creating namespaces on the fly? This would mimic
> the behavior of PackageInfo. Such a lightweight Namespace would know
> nothing about itself but its name. If I create a "Namespace named:
> #Whatever" and ask it for its bindings, it just looks into Smalltalk
> and selects all matching associations. Of course, one could then create
> specialized Namespaces, just like some people create specialized
> PackageInfos, but the system works fine without them.
Mmmmm, possibly. Though I am a bit wary of such "lightweight" objects
because all of a sudden we want state in them and then we end up
creating instances anyway. And flyweights like PI aren't very intuitive.
Their lack of identity have bitten me before.
> Also, I thought namespaces should mostly be invisible in Göran's World
> ;-) So, the class-template where now some namespace is magically chosen
> could actually just show an unqualified name. Otherwise, we have to
> rewrite every Fine Manual that shows how to create a class ...
Hmmmm. I am trying to make them as "invisible" as possible - but... I
thought it was good to at least make the reader/author aware of that
there is something called a qualified name. Because they do show up both
here and there in the tools and the code.
Also, you can still create global classes just like before without a
qualifier. So it all boils down to if the template should auto-suggest a
space or not. :) Easy to change back if you like. Could even be a Pref.
:)
> > Very neat to see this all working, though.
>
> Indeed :)
My current dev version also has a "full conversion" script that actually
works! It blew up on me a few times before getting it right. So I
currently have these spaces in my image:
an OrderedCollection(a SystemDictionary(lots of globals) Colors::
Fruits:: Trees:: Monty:: Sound:: Speech:: Tools:: Network:: Nebraska::
ST80:: Morphic:: Movies:: Balloon:: FFI:: StarSqueak:: Protocols::
Framework:: Squeak:: EToy:: SARInstallerX:: Multilingual:: SUnit::
PackageInfoX:: Babel:: SmaCC:: CompilerX:: ProjectsRepositoryClient::
Tests:: Exceptions:: TextX:: VersionNumberX:: MCInstaller:: SMBase::
SMLoaderX:: Namespaces::)
Note that I added an X to some of those in order to not clash with
existing global. Also let the so called kernelCategories stay as
globals:
#(Kernel Collections Graphics System)
I had some trouble converting those - but now I wonder what it was...
hmmm. Anyway. :) I will post new code in an hour or two. Also improved
performance of the rendering part so that it doesn't make the tools so
slow (hint: "Namespace allInstances" isn't very fast)
> - Bert -
regards, Göran
More information about the Squeak-dev
mailing list
|