On Sun, 8 Jul 2001, Marcel Grunauer wrote:
> On Sunday, July 8, 2001, at 09:34  AM, Aleksei Guzev wrote:

> > Raising exceptions on trying to add some kilograms to some miles would
> > protect user of a lot of algorithmical mistakes.
> 
> AFAIK, Damian Conway has such a module in the making:
> 
> 	use Data::Units;
> 	my $weight : Unit(kg) = 20;

A few months ago Masahiro Tanaka wrote to me in http://ruby-talk.org/12839
that he had written a units package better than the one I had just posted
in http://ruby-talk.org/12821 while thinking "this surely has been done in
Perl anyway".

The big difference is that they're value-oriented instead of
variable-oriented, so they cannot restrict from assigning kilogram value
into miles variable;  however it will restrict addition of miles and
kilograms together... 

...unless someone makes it multiply by 1.608 miles/kilograms, or generally
speaking, adds the feature that the argument is coerced to the unit of the
receiver if the units are compatible.

matju