Al Lipscomb writes:
>I was wondering about maybe being able to store these 
> attributes as
> optional parts of the scalar. Something like this (please 
> don't get hung up
> on the details, I am not much of a designer):
> 
>    my($amt,$hours,$total);
>    $amt->{TYPE} = "DOLLARS";
>    $total->{TYPE} = "DOLLARS";
>    $hours->{TYPE} = "INTEGER";

I've seen this kind of idea tossed around for a number of years (my first
recollection is a SIGPLAN article in the early 1980's, although I'm sure the
idea dates before then).  For those of us in the engineering world, it would
help with making sure we were using the right sort of units all the time.
(Mars Climate Orbiter, anyone?)  But IMHO this only works if:
* Units of measure are optional;
* Units of measure are fast; and
* Implementing units of measure don't appreciably slow down computations
that don't use units of measure.
====================================================
Mark Leighton Fisher    Thomson Consumer Electronics
[EMAIL PROTECTED]         Indianapolis, IN, USA
"Display some adaptability."  -- Doug Shaftoe, _Cryptonomicon_

Reply via email to