[GOODIE] Namespaces-gk

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


Hi people!

Yiha, here comes a first WORKING implementation of "the little proposal"
on Namespaces! It is fresh out of the debugger, with wrinkles and all.
Play around with it and discuss it. Tested in latest 3.7beta, not tested
in *anything else*.

And you say - Ok, but haven't followed the thread, what the heck is this
crap?

It allows you to create classes with what I call "qualified names" like
this:

	MyNameSpace::MyClass

That is pretty much it. :) It is only one level deep, the namespaces
have no inter-relationships (no inheritance or anything) and there are
NO IMPORTS.

You just create your classes with qualified names and then code just
like before - using *either* the qualified names or the unqualified -
the tools will help you when there is doubt.

And there is nothing stopping you from installing this and still just go
on like before using unqualified names!

IMHO it is pretty damn hard to make it any simpler than this.

regards, Göran

from preamble:

"Change Set:		Namespaces-gk
Date:			15 April 2004
Author:			Göran Krampe

This is the first working implementation of the 'little namespace
proposal' I have posted about. It contains a bunch of base modifications
and two new classes in category Namespaces. They have class comments. :)

The code can be made a bit more succinct - it has gone through a few
hoops along the way.

Play with it, check out the feel. I have not yet implemented shyness
btw.

AFAIK this is the simplest and most backwards compatible way of
introducing namespaces.

Known issues:
- Namespaces are automatically created for you but not removed when
empty. Just use Smalltalk removeKey: #MySpace

- I have of course not gone through all the tools, but the browser seems
to work as it should including rename/delete/copy class."!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Namespaces-gk.cs.gz
Type: application/octet-stream
Size: 10445 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20040415/d57d3293/Namespaces-gk.cs.obj


More information about the Squeak-dev mailing list