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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 103376,1dd28d5040ded1f8 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-05-14 11:07:54 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.tele.dk!small.news.tele.dk!128.39.3.168!uninett.no!ntnu.no!not-for-mail From: Preben Randhol Newsgroups: comp.lang.ada Subject: Re: Announce: Grace project site operational Date: Tue, 14 May 2002 18:07:53 +0000 (UTC) Organization: Norwegian university of science and technology Message-ID: References: <4519e058.0205140718.3ddb1b2a@posting.google.com> NNTP-Posting-Host: kiuk0156.chembio.ntnu.no Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: tyfon.itea.ntnu.no 1021399673 15970 129.241.83.82 (14 May 2002 18:07:53 GMT) X-Complaints-To: usenet@itea.ntnu.no NNTP-Posting-Date: Tue, 14 May 2002 18:07:53 +0000 (UTC) User-Agent: slrn/0.9.7.4 (Linux) Xref: archiver1.google.com comp.lang.ada:24045 Date: 2002-05-14T18:07:53+00:00 List-Id: On Tue, 14 May 2002 17:50:47 GMT, tmoran@acm.org wrote: > How about a(nother) new Ada 0x construct: > dimension > optionally appended to a type declaration, eg > type Seconds is new Float; > type Centimeters is new Float; > type Grams is new Float; > type Velocity is new Float dimension Centimeters/Seconds; > type Acceleration is new Float dimension Velocity/Seconds; > type Dynes is new Float dimension Grams*Acceleration; > t : Seconds; > d : Centimeters range 0.0 .. 100.0; > v : Velocity; > f : Dynes; > Then have the compiler allow an expression like "v*t" and have it > do the dimensional analysis at compile seconds to know the result is > of some declared type, in this case Centimeters. v+t is still > caught as an error and, since neither a square centimeter nor an erg > type have been declared, expressions like d*d and f*d are caught. As a chemist I want mol and Kelvin, but how do one deal with constructions like this: Constant = (C1*C2)/(C3^0.5) = mol�/mol^0.5 = mol^(3/2) or Constant = C1/C2 = mol / mol = unitless Preben