[Modules] C and Smalltalk modules

Anthony Hannan ajh18 at cornell.edu
Tue Nov 13 19:13:03 UTC 2001


Hello again, here's a simpler description of the modules I presented in my 
previous email.

	A module is an object that introduces new objects and specifies changes
to existing objects in imported modules.  When a module is linked its
changes are applied to the existing objects.  When a module is unlinked
its changes are undone.  A module is automatically linked when a process
that has the module in its environment becomes active.  Process has a
new instance variable called environment that points to a module.  A
module is IN an environment iff the environment directly or indirectly
imports the module.  A module is automatically unlinked when a process
that does NOT have the module in its environment becomes active.
	Pointers that cross module boundaries are converted to identifiers when
unlinked and converted back to pointers when linked.  For example, a
class Foo introduced in ModuleB may have its superclass Bar introduced
in ModuleA, an import of ModuleB.  When ModuleB is unlinked, Foo's
superclass will contain the identifier #Bar.  When it is linked back it
will contain the class Bar.  If there is no global pointing directly to
Bar, its identifier will specify a path to Bar from a global, for
example #Classes.Bar.
	Modules only deal with objects and identifiers and is independent of
any class (or classless) structure.

Thanks,
Anthony




More information about the Squeak-dev mailing list