Steps to Modularity - Nested Global Variables

stan at stanheckman.com stan at stanheckman.com
Thu Mar 18 21:26:25 UTC 1999


Dan Ingalls <DanI at wdi.disney.com> writes:
> 5.  I would include as part of this change, to do away with the notion of po=
> olDictionaries.
> 	What do you think about that?
> 	I find that most uses are covered by classVariables in a superclass,
> 		and I feel the rest could be handled fine by dotted globals.

I write code that uses the pool variables "Kilogram", "Joule", and
"Centimeter".  No superclass other than Object contains all classes
using these pool variables, so I should use dotted globals, not
classVariables.  I find that I often use compound units, which I
presently write as (Volt / Meter) / (Coulomb * Kilometer). These
become unwieldy if written (PhysicalUnits.Volt / PhysicalUnits.Meter)
/ (PhysicalUnits.Coulomb * PhysicalUnits.Kilometer)

So I ask, does Dan's solution allow the following?
  | u |
  u := PhysicalUnits
  (u.Volt / u.Meter) / (u.Coulomb * u.Kilometer)

-- 
Stan





More information about the Squeak-dev mailing list