What class should include "5 kilograms"?

Michael S. Klein mklein at alumni.caltech.edu
Wed Nov 11 05:07:39 UTC 1998


I would design something that binds together tensors and units.

I.e. 4 meters per second is a scaler (rank 0 tensor)
A force vector (rank 1 tensor) could have the units of pounds.

Math is one of those areas where the static single inheritence model of 
Smalltalk is not so hot.  Double dispatching, coersion, adaptation, etc.
are mechanisms to do something else without being totally ad-hoc.

For an interesting read, see Structure & Interpretation of Computer Programs,
Chapter 2.  Of particular interest is footnote 52 on page 200.
(it is in a section named 'Inadequacies of hierarchies' on the statement
"Dealing with large numbers of interrelated types while still preserving 
modularity in the design of large systems is very difficult, and is an 
area of much research."

Math is hard,
	Mike Klein





More information about the Squeak-dev mailing list