[Modules] Module variables

Lawson English english7 at mindspring.com
Wed Aug 29 21:59:55 UTC 2001


I'll try to be a little more clear:

Java has 4 access rules for class members (instance variables):

public -this has no equivalent in Smalltalk
private - this has no equivalent in Smalltalk
protected -this is the standard for instance variables in Smalltalk
package access -this has no equivalent in Smalltalk


What I am suggesting is that two new types of access be defined for
Smalltalk:

Module instance variables -accessible only by objects of a class or
sub-class defined within the module -roughly equivalent to package access in
Java

Module global variables -accessible via the pool dictionary strategy ONLY to
classes defined within a module (and to any subclass?) -roughly equivalent
to package access for pool variables.


Module instance variables can be handled in the class definition:

moduleInstanceVariableNames''



Module global variables are handled by using the dummy dictionary name
"Module" which defaults to "Smalltalk" if the package is used by itself.

All classes in a given module should have automatic access to the "Module"
pool, just as they do to "Smalltalk" but ONLY classes defined in a given
module (and their sub-classes?) should have access to the Module dictionary.


Hope this makes more sense.



on 8/29/01 2:26 PM, Lawson English at english7 at mindspring.com wrote:

> I haven't seen it mentioned before, so i'll throw this in:
> 
> should there be a new kind of instance variable defined that is associated
> with a given module? Likewise, a "global" module variable might be defined
> as well.
> 
> This might be a variant of pooled variables where only classes defined
> within the module know about and can use  variables in the specific module
> pool, and using the module-pool dictionary is implicitly managed since there
> is only one of them per module and the name of the dictionary is redundant
> and probably better left unspecified anyway.

-- 
The real romance is out ahead and yet to
come. The computer revolution hasn't started yet. Don't be misled by
the enormous flow of money into bad defacto standards for
unsophisticated buyers using poor adaptations of incomplete ideas. -Alan Kay
--





More information about the Squeak-dev mailing list