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-7-bit X-Google-Thread: 103376,cc4f25d878383cc X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-12-07 01:01:41 PST Path: archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!news.tele.dk!small.news.tele.dk!130.133.1.3!fu-berlin.de!uni-berlin.de!tar-alcarin.cbb-automation.DE!not-for-mail From: dmitry@elros.cbb-automation.de (Dmitry A. Kazakov) Newsgroups: comp.lang.ada Subject: Re: Another Idea for Ada 20XX Date: Fri, 07 Dec 2001 09:01:38 GMT Message-ID: <3c107e34.1089468@News.CIS.DFN.DE> References: <3C0AACCE.329CFB60@worldnet.att.net> <45601fc.0112031740.3e217c8a@posting.google.com> <3C0CF4E3.A53D20A7@sparc01.ftw.rsc.raytheon.com> <3C0EF0A0.9F42EDB4@adaworks.com> <3C0FAD3D.64ACC870@usa.com> <45601fc.0112061655.29c31a48@posting.google.com> NNTP-Posting-Host: tar-alcarin.cbb-automation.de (212.79.194.111) X-Trace: fu-berlin.de 1007715698 10421604 212.79.194.111 (16 [77047]) X-Newsreader: Forte Free Agent 1.21/32.243 Xref: archiver1.google.com comp.lang.ada:17553 Date: 2001-12-07T09:01:38+00:00 List-Id: On 6 Dec 2001 16:55:38 -0800, byhoe@users.sourceforge.net (Adrian Hoe) wrote: >Wes Groleau wrote in message news:<3C0FAD3D.64ACC870@usa.com>... >> >> function "+" (Left : Meters; >> Right : Kilometers) >> return : Meters; > >Consider this: > >function "+" (Left : Meters; > Right : Inches) > return Meters; > >What kind of precision in the conversion of Inches to Meters if Unit >Checking and Conversion are to be part of Ada? Do I/we have the >liberty to select the precision I/we want? A possible solution is that there should be same precision of Left, Right and result. They should have exactly same representation [in some unit system, like SI] and Inches would be just a view of some length [which corresponds to the physical nature of meters and inches]. So X : Inches := 5; -- Means X := 0.127 [m] Unfortunately the price of this is that it will be impossible to have precise computations in non-metric units and range problems [eV is pretty small when compared with J]. However, it is thinkable [and preferable] that Ada would provide not an implementation of some unit system, but rather facilities to do it. Then of course, a user might just create its own unit system like (foot, second, pound) and have meters as a view of feets. He would also be able to create two different systems and define conversions between them with necessary care of precision. >How exactly this will be implemented by the new annex of Ada >(perhaps)? Regards, Dmitry Kazakov