Incorporating dimensional-analysis facilities in a language lets an environment detect an additional class of errors, but at the expense of requiring a change to the language you used. However, if the language you used has suitable data-abstraction facilities, most of the benefits of dimensional analysis can be had without changing the language. To demonstrate how to get these benefits, the authors use the data-abstraction facilities of C++ to implement dimensional analysis. C++ is an upwardly compatible extension of C that provides data-abstraction facilities called classes. The authors define a set of classes that allows the writing of programs with automatic checking of units (i.e. dimensional analysis) and automatic conversion between consistent (compatible or equivalent) units. They discuss the pros and cons of this approach and compare the advantage C++ has over Ada for implementing dimensional analysis.<<ETX>>
[1]
Paul N. Hilfinger,et al.
An Ada package for dimensional analysis
,
1988,
TOPL.
[2]
Narain H. Gehani.
Ada's derived types and units of measure
,
1985,
Softw. Pract. Exp..
[3]
Bjarne Stroustrup,et al.
C++ Programming Language
,
1986,
IEEE Softw..
[4]
David B. Loveman,et al.
Incorporation of units into programming languages
,
1978,
CACM.
[5]
R. C. Pankhurst,et al.
Dimensional Analysis and Scale Factors
,
1964
.
[6]
Ronald T. House.
A Proposal for an Extended Form of Type Checking of Expressions
,
1983,
Comput. J..
[7]
Narain H. Gehani.
Databases and Units of Measure
,
1982,
IEEE Transactions on Software Engineering.
[8]
Narain H. Gehani,et al.
Units of Measure as a Data Attribute
,
1977,
Comput. Lang..