Abstract

We first consider the general problem of assigning attributes to variables in programming languages and the benefits that accrue from this. Then we propose the addition of the units of measure of the real world quantity being represented as an additional attribute in programming languages (in science and engineering the units of measure of a quantity are called its dimensions; some examples of units of measure are dollars per year, calories, pounds per square foot, person years etc.) the specification of the UNITS attribute by the programmer allows the detection of a class of errors not detected by present day programming language processors. This kind of error detection is of great importance to programmers dealing with complicated expressions and formulae. Better syntactic error correction, better program documentation, automatic conversion of quantities from one unit of measure to another, and some pedagogical help in teaching programming are the additional benefits that we get. We develop a notation that blends in naturally with Pascal, the language used to communicate our ideas. All or most of the additional processing required by the UNITS attribute can be done at compile time depending upon how ‘dynamic’ the units of a variable are allowed to be. Giving some thought to practical considerations, the concept of the UNITS attribute is being implemented as an extension to Fortran by means of a preprocessor.

Full Text
Paper version not known

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call

Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.