RE: Unit validation in spreadsheets



Does this transformer/validator have to be created per 
function (for all functions?).

Yes.

Isn't there a more minimalist 
approach available - for example, adding and subtracting need 
to take the same units, whatever they are. Multiplication and 
division can take any unit. Other functions might not care 
about units.

That's exactly what the transformers enforce.
So you specify the transformers for addition and 
subtraction as

 + :: u,u -> u
 - :: u,u -> u 

That wasn't much work, right? :-)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]