Need feedback on one idea

ducasse ducasse at iam.unibe.ch
Sun Sep 7 15:03:48 UTC 2003


>> You unify them. You do not have cassVariable and poolVariable
>> to explain and have instance variable, class instance, and class
>> variable AND pool. Just "global" variables in a namespace and
>> instance and class instance variables.
>
> But how do you deal with (intentional) sharing and (intentional) 
> locality?

Only namespace would offer that. And may be we need to keep classVar.
Thanks for the question.

BTW:
Character>>initialize
	"Create the table of unique Characters. This code is not shown so that 
the
	user can not destroy the system by trying to recreate the table."
	
How can I see this method....I found that really frustrating.
I tried Character class sourceMethodAt: #initialize but without success.

> E.g., taking TextConstants - would they end up in a global name space 
> where
> (for example) Cr is the same as String Cr or similar?

I have the impression that we would need namespace import.. not so 
simple.
I like your example a lot thanks for this.
>
>> Then Pool are really ugly and static (try to change the value of
>> a pool variable and see how the method refering to it can break :))
>
> How do "namespace variables" address this problem?

they have nothing magic if you do not have pool variables whose value
are computed at compiled time and put in the compiled method (I should 
replay with these to be sure but
in VW it was like that), but only have message send or variable access
then you do not get the problem

>>> What do you mean by namespace variables? There are no namespaces
>>> in Squeak yet?
>>
>> Yes there are, SystemDictionary is a namespace and environment its
>> subclass it clearly that. This is just that nobody use that except
>> henrik for his module stuff.
>
> Can you say a few words about what would be different/better when 
> using this
> approach compared to class variables and pools? Somehow it seems to me
> you're just exchanging two equivalent concepts.

I'm trying to see :)
I think that it simplifies: you do not have global variable such as 
Smalltalk, pool and class variable
but just variable in namespaces.

We could do it without namespaces but in such a case you would lose the 
possibility to make a difference
between sharing. Not so simple.

Stef

>
> Cheers,
>   - Andreas
>
>
>



More information about the Squeak-dev mailing list