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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,9742b7560760142d X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!feeder3.cambrium.nl!feeder6.cambrium.nl!feed.tweaknews.nl!border2.nntp.ams.giganews.com!nntp.giganews.com!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsfeed.arcor.de!newsspool1.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: WG: SI Units - has Ada missed the boat? Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: Date: Mon, 9 Jul 2007 11:49:15 +0200 Message-ID: <9b9meiq7n6ha.y9tw152a6m2r$.dlg@40tude.net> NNTP-Posting-Date: 09 Jul 2007 11:45:56 CEST NNTP-Posting-Host: cb4c3456.newsspool4.arcor-online.net X-Trace: DXC=CI[I`ab^\Z>;]cDoEWD6A44IUK7enW;^6ZC`4IXm65S@:3>?F50FQ\e2]X= X-Complaints-To: usenet-abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:16437 Date: 2007-07-09T11:45:56+02:00 List-Id: On Mon, 09 Jul 2007 10:55:53 +0200, Grein, Christoph (Fa. ESG) wrote: >> One of my pet hopes for Ada2005 was that it would include some method >> of automatically checking systems of units at compilation time or with >> minimal run-time checking. Alas it was voted down due to time > > I have to admit that I was the main perpetrator who killed that > proposal. Fortunately. Be praised for that! >> Is anyone still working on an Ada solution to this? > > I don't think so, if you mean a method to include in the Ada standard. Yes, and if we'd put together more or less obvious requirements of how an Ada(tm) solution should look like, we would easily see a need in some language changes. My strong impression is that these changes should go beyond sole units support. For example, it is quite obvious that the unit constraint should be put on the object, be it a floating-point number or a matrix of. We just don't have any universally working mechanism for that. Same with dimensioned literals, which would imply a user-defined literals support, etc. In short, units is just a use case, it should not be viewed as a language feature. > But there are a lot of such methods distributed in some home pages, see > Dmitry Kazakov, mine, ... (I guess there are plenty others) The new version of my measurement units for Ada with GTK tree view cell renderers and combo boxes for dimensioned values is coming soon. > I don't know C++ and so I do not know how it deals mit rad, Newton > Meters and Joule in > > Work [Joule] = Torque [Newton*Meter] * Angle [rad] > > Or sin x = x + x**3/3! + ... where x is in rad, sin x has dimension 1 > (not rad). > > Or Bq = 1/s, Hz = 1/s, but Bq /= Hz. Such differences should be handled outside the unit system. It cannot know the semantics of the values. So rad = 1 SI. Or else m (of height) /= m (of distance on a highway) But how C++ handles (I guess it does not) X := Vector (I); -- Both X and Vector are dimensioned Y : Unit := Ask_User_For; Z : Magnitude := 5 dB; -- May I have logarithmic scales? -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de