[Modules] Name space semantics was: Re: Some of my thoughts

Andreas Raab Andreas.Raab at gmx.de
Thu Aug 16 07:21:45 UTC 2001


Stephen,

> Simple example:
>
> 	- "Package A" overwrites the method #add: on OrderedCollection.
> 	- The method doesn't work properly and brings the system to its
> knees (try it!)
>
> What I have in mind solves this problem (providing that you are
> developing within a package).  (note: people have previously suggested
> that each package resolve the same symbol to a different object, but I
> don't think this is the best way to go)

But where is your proposal different? As far as I can see you do resolve the
symbol #add: into different objects, namely #42add: (or #56add: for that
matter). And wouldn't it be simpler to do something like implement #42add:
as

Object>>42add: anObject
	^self 56add: anObject.
Object>>56add: anObject
	^self add: anObject.

At least there's no need to modify the VM lookup machinery *and* you may
have a chance to actually find out what's happening if you send (what you
think is) #add: to some object.


Cheers,
  - Andreas





More information about the Squeak-dev mailing list