From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,c7ea1cb7a2beb2ee X-Google-Attributes: gid103376,public From: Bryce Bardin Subject: Re: Disallowing Pre-Defined Operations Date: 2000/03/16 Message-ID: <38D06B59.7EA0E4B3@home.com>#1/1 X-Deja-AN: 598129966 Content-Transfer-Encoding: 7bit References: <8a9eeg$qtv$1@newpoisson.nosc.mil> <8ababr$c3u$1@wanadoo.fr><8afhed$f9v$1@newpoisson.nosc.mil> <8aoifb$49f$1@newpoisson.nosc.mil> <38D001D7.4D6E4284@averstar.com> X-Accept-Language: en,en-GB,en-US,fr,fr-BE,fr-CA,fr-FR,fr-CH,de,de-AT,de-DE,de-CH,it,es,es-AR,es-CO,es-MX,es-ES Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@home.net X-Trace: news1.alsv1.occa.home.com 953183061 24.16.167.81 (Wed, 15 Mar 2000 21:04:21 PST) Organization: @Home Network MIME-Version: 1.0 NNTP-Posting-Date: Wed, 15 Mar 2000 21:04:21 PST Newsgroups: comp.lang.ada Date: 2000-03-16T00:00:00+00:00 List-Id: Tucker Taft wrote: > ... Personally, I would like a full-up > "units" capability, where generally A * A => A is not defined, since > that doesn't balance from a units point of view. I have some ideas > how to get there, and would be interested in opinions from others. > The techniques using discriminants are unsatisfactory in my view, > and too "heavy." VHDL has the notion of "units" built into the language, > and its approach should probably be evaluated. I have always felt that a full-up, type-safe, compile-time-checked, units capability is the one potential "killer" capability that has the potential to make Ada the language of choice for engineers and scientists world-wide. But it must be *easy* to use (not feel cumbersome) and have no run-time cost. I believe that it should be based on the International System of Units (SI), but also incorporate units conversion capabilities, so that commonly used systems of engineering units can be gracefully accommodated. I don't think that the number of underlying relations would be prohibitive; see for instance: http://physics.nist.gov/cuu/Units/units.html, et seq. If all units checking is performed in SI and the relationship to the various systems of engineering units is implicitly known to the compiler (or processor), dimensional checking is straightforward. Mixed units calculations should be forbidden, absent appropriate conversions. What remains then is to determine how to specify the units on types and values, and how to specify unit conversions. It is not clear to me whether the basis of such a capability needs to be supplied within the confines of the current language, or whether a "preprocessor" acting on annotated source would be adequate. Bryce Bardin