Quick comparison of two Namespaces proposals

Göran Krampe goran at krampe.se
Thu Sep 20 08:43:00 UTC 2007


Hi Keith!

[SNIP]
> Class WASession -> WASession
>
> and we define WA similarly, then
>
> WA Session -> WASession

This would be trivial to do right now in my proposal. WA:: is already an
object of instance Namespace sitting in Smalltalk so if I add a DNU to it
- you got that.

And we could even add a "mapping" mechanism based on sender, like for
example, looking at the PI of the sender and decide if we want to resolve
in self (WA::) or delegate to another namespace (WA28::).

> If we make WA the current 'in' namespace, then Class could take that
> into account, so that
>
> Class Session -> WASession

I presume the idea here is to do totally "context dependent" resolution,
right? First of all, I would probably use Smalltalk instead of Class - we
are after all talking about globals and not ONLY classes.

So then you could write:

    WA Session

..or:

    Smalltalk Session

The first line would mean, give me "Session" in namespace WA:: - and
decide yourself what to give me back depending possibly on me as a sender
and on any other runtime aspect.

The second line would mean, give me "Session" in whatever namespace is
suitable (including the global space) depending possibly on me as a sender
and on any other runtime aspect.

> for tool support, each prefixed class would need to know its
> prefix.namespace so that tools could show the class name in browsers
> without the prefix.

Again, this already works in my proposal though.

In summary, yes, we can have message based simply dynamic lookup that can
take runtime context and sender into account. But do we REMOVE all
statically bound references and DISALLOW them from now on? That is a
*much*
larger step IMHO and I can't say I have thought through all ramifications
of such a route.

regards, Göran

PS. I can add the above DNUs to my proposal just to show how it can work etc.




More information about the Squeak-dev mailing list