[ANN] Revised "Units" port for 2.9a

Helge Horch Helge.Horch at munich.netsurf.de
Thu Oct 5 02:06:37 UTC 2000


Folks,

just a reminder; a recently-revised version (#3) of my port of Andrew 
Brault's Units framework is currently being served at

<URL:http://home.munich.netsurf.de/Helge.Horch/squeak/units.html>

Changes since Squeak 2.3 (ahem):

* License changed to Squeak-L (per Andrew's permission)
* Number>>isZero deleted from changeset (is now in base system)
* SmallInteger>>/ and Float>>/ methods revised
   (still raise exception, but use #isZero)

Haven't tried it under 2.8 yet, will appreciate reports.

To give a sketch of what it does:  Represent, generally juggle, and perform 
calculations with physical measurements like

"You can add, divide, multiply, and subtract UnitValues."
(2 units: #inches) / (3 units: #seconds).
   (2/3) inches per second

"Adding or subtracting units does appropriate conversions."
(14 units: #feet) + (10 units: #meters).
   46.8083989501312 feet

"You can also explicitly convert values."
(15 units: #miles) / (1 units: #hours)
     convertTo: (Unit meters / Unit seconds).
   6.7056 meters per second

"You can expand 'derived' units such as the newton into base SI units."
(3 units: #newtons) baseUnits.
   3000 gram meters per square second

"To see kilograms rather than grams, factor with respect to kilograms."
(3 units: #newtons) factor: Unit kilograms.
   3 kilogram meters per square second 





More information about the Squeak-dev mailing list