A package for handling units of measure in Lisp

A package for handling units of measure in Lisp
复制标题

Lisp 中处理测量单位的包

DOI:
--
复制
发表时间:
1992
期刊:
LIPO
影响因子:
--
通讯作者:
R. Cunis
R. Cunis
中科院分区:
--
文献类型:
--
作者:
R. Cunis

文献摘要

被引文献

相似文献

在编程环境中处理测量单位的能力,以及在科学和工程程序中处理数值量的能力,极大地有助于实现计算安全以及代码和数据的可读性。它允许维度分析,从而防止不同维度的值的错误组合,例如将距离添加到质量,或防止缩放错误,例如将以英寸测量的距离分配给应该保持厘米的变量。将值和变量与度量单位相关联明确地澄清了代码和数据,并且--如果有一个聪明的编译器--允许在编译时执行上述维度分析。如果扩展到用户数据的输入和输出,它可以使用户在输入符合程序定义的测量单位的数据时不必自己执行适当的缩放。它还可以方便地定制输出,以便向熟悉不同测量单位集的用户提供计算结果,例如英国和美国使用单位与公制单位。
The ability to handle units of measure in a programming environment together with numerical quantities in scientific and engineering programs helps greatly in achieving computational safety as well as code and data readability. It allows for dimensional analysis, thus safeguarding against erroneous combination of values of different dimensionality, e.g. adding distances to masses, or against scaling errors, e.g. assigning distances measured in inch to variables supposed to hold centimeters. Associating values and variables with units of measure explicitly clarifies code and data and---given a clever compiler---allows for the above-mentioned dimensional analysis to be performed at compile time. If extended to input and output of user data, it might free the user from the burden to perform proper scaling himself when entering data conforming to program-defined units of measure. And it might allow for easy customization of output in order to present computational results to users familiar with different sets of units of measure, e.g. British and American use of units versus metric units.