name spaces (was: Persistent Segments)

Jecel Assumpcao Jr jecel at merlintec.com
Wed Feb 21 23:21:13 UTC 2001


On Wed, 21 Feb 2001, Les Tyrrell wrote:
> [Alien and Base modules example and mutiple Symbol tables]

Hmm... it seems to me that this won't get you very far. Let's call
#size1 the result of executing 'size' asSymbol in a Base method and
#size2 the result of the same expression in an Alien method.

When the compiler generates the bytecodes for some new Alien method, it
is #size2 that is included in the literal vector. When that message is
sent, the #size2 String method provided by Alien is invoked and not
#size1 that is in Base.

The first problem I see is that Alien must reimplement every single
String method, even the ones it doesn't want to change. Now that might
even be a good thing since it becomes less dependent on Base. But it
seems wasteful to me.

Another problem is if an Alien method wants to send the 'size' message
to an OrderedCollection which is not implemented in Alien. If it uses
#size2, then it won't work since classes defined in Base expect #size1.

The problem is that you lack a dimension when you deal exclusively with
Symbols. See the Us language for an explanation about this:

   http://citeseer.nj.nec.com/smith96simple.html

I never found any details about how SmalltalkAgents handled this
problem, but had the impression that their classes had multiple method
dictionaries and lookup depended on a "sending environment" somewhat
like Us.

-- Jecel





More information about the Squeak-dev mailing list