Maenner Pascal extensions(ID:8024/)

Pascal extended for physical quantities 

Set of extensions to Pascal (after the fashion of extended Ada types) proposed by Männer 19886  Physical Institute, University of Heidelberg, F.R. Germany to enable the recording of physical quantities.

  • Männer, R. "Strong typing and physical units" pp11 - 20 view details Abstract: This paper proposes a syntactic extension of high level languages like PASCAL or ADA to allow the usage of physical quantities, i.e. numbers with units, instead of just numbers. It offers enhanced type checking for expressions and assignments during compilation time. Additionally, it allows problem oriented simple scaling of variables and local scale selection. Furthermore, it reduces the number of coding errors due to wrongly chosen scales. After a discussion of mutual relations between strong typing in programming languages and physical units, examples are shown to demonstrate the usefulness of the proposed extension. Finally a graph representation of the new syntactic elements is given. External link: Online copy Extract: Summary
    In this paper, an extension of high level languages like PASCAL has been proposed that allows the declaration of physical dimensions and units for constants, variables and functions. The basic idea behind the proposal was discussed, and examples for applications were given demonstrating the usefulness of the new constructs. It was shown that several additional types of compilation time checks will be possible, and that programming will be saver by the possibility of choosing the scale for literal constants locally. In some circumstances, the ability to enforce the internal representation of a quantity in a certain unit might be an additional benefit of the proposed syntax extension. The new syntactic elements were described in a graph representation. An implementation was suggested which restricts the necessary syntax modifications as far as possible with the additional effect to enforce the programmer to assign meaningful ranges to variables and function results.

          in SIGPLAN Notices 21(03) March 1986 view details