Name spaces in Spoon

Alejandro F. Reimondo aleReimondo at smalltalking.net
Fri May 26 22:46:31 UTC 2006


Hi!,

> A few comments:
thanks!

> 1. It would move the binding time to runtime instead of compile time (or
> if you prefer to call it "code install"-time). I can probably imagine
> both pros and cons with that. It is a big change.

The method that implements the message will be simply
 a return of an association.
It is solved without activating a method context (like
 primitive methods that do not fail); so the time spent in getting
 the real object is too small and dynamically optimizable.

> 2. In my personal opinion it is less readable than
> MyGlobalContext::ThisClass. It blends into the rest of the code so that
> the reference itself doesn't "stand out". It also deviates from the
> "words beginning with capitals refer to classes (or globals)".

  MyGlobalContext thisClass

can also be used and hacked by dnu mechanism.

> 3. The :: solution actually does not "need new syntax". It just needs us
> to allow $: in global names. Sure, you can call it a "syntax change" -
> but it is very, very small.

On the "pros" side we must consider that mesage sending
 can be used to reroute class targets, do some profiling, ...
 or pinging to remote objects (to move bechavior when
 really needed).

cheers,
Ale.



----- Original Message ----- 
From: <goran at krampe.se>
To: "The general-purpose Squeak developers list"
<squeak-dev at lists.squeakfoundation.org>
Sent: Friday, May 26, 2006 4:57 PM
Subject: Re: Name spaces in Spoon


> Hi!
>
> "Alejandro F. Reimondo" <aleReimondo at smalltalking.net> wrote:
> > Hi,
> >
> > > > It was something like Prefix::ClassName and the point was that only
> > > > one or two places in the image had to change to legalize that kind
of
> > > > name.
> > > Yes, the patch to get a Squeak image to accept code using such global
> > > names is very, very small.
> >
> > What do you think about sending the name
> >  as message...
> >     MyGlobalContext::ThisClass
> >  becomes:
> >     MyGlobalContext ThisClass
> >  the global context (aNameSpace, anEnvironment
> >  or SystemDictionary)
> >  can respond to the message returning the real
> >  object (or via dnu build a method to return it)
> > Using this "trick" we do not need new syntax
> >  and the solution is solved as usual (sending messages).
> >
> > bets,
> > Ale.
>
> Just wish to note that this approach was indeed tested IIRC in the
> 3.3modules code, and if my memory serves me right Dan proposed it - but
> I am not sure. Personally I was hesitant at the time, and still is.
>
> A few comments:
>
> 1. It would move the binding time to runtime instead of compile time (or
> if you prefer to call it "code install"-time). I can probably imagine
> both pros and cons with that. It is a big change.
>
> 2. In my personal opinion it is less readable than
> MyGlobalContext::ThisClass. It blends into the rest of the code so that
> the reference itself doesn't "stand out". It also deviates from the
> "words beginning with capitals refer to classes (or globals)".
>
> 3. The :: solution actually does not "need new syntax". It just needs us
> to allow $: in global names. Sure, you can call it a "syntax change" -
> but it is very, very small.
>
> regards, Göran
>




More information about the Squeak-dev mailing list