My namespace proposal shaping up...

goran.krampe at bluefish.se goran.krampe at bluefish.se
Tue Apr 13 10:27:45 UTC 2004


Hi all!

Just wanted to say that I now have successfully hooked into when typing
code to so that it works just like I described it - if you type "Delay"
then fine (if it is unique or defined locally), if there are multiple
choices it asks etc. Nice indeed.

Anyway, AFAICT the only things left for me to hack is to make my current
solution "cleaner" by:

- Not using a class name that is fully qualified in the class itself.
Craig has been giving me a hard time about that :), but it was merely
meant as a cheap way to avoid quite a lot of changes. But I am hoping
that I can make it work anyway.

- Together with the above I will not keep entries like "Kernel::Delay"
in Smalltalk. It will be solely held in the Namespace instance that is
held in Smalltalk under #Kernel. But I intend to rewrite
SystemDictionary so that this would still work:
	Smalltalk at: #Kernel::Delay
This affects a bunch of other methods, but it actually looks hackable.
At least worth a try and it would make it much prettier (no redundant
entries up at the top level in Smalltalk) and still quite backwards
compatible.

- Tweak the class creation template so that it offers a namespace:
option alongside with category: with autocreation of Namespace instances
etc. Tyically a Preference.

- Write a "turn this image into one with a few basic Namespaces" method.

My solution will still allow real globals and I think we should keep
Transcript etc. This also means that creating classes just like before
is quite allright (as a true global).

Anyway, code will be published later tonight. Since I think people can't
judge my proposal before they can really see it in action (or any other
proposals for that matter) I think we can continue the discussion at
that point.

regards, Göran



More information about the Squeak-dev mailing list