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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,608011466ae2af71 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Received: by 10.68.223.40 with SMTP id qr8mr8056981pbc.0.1341156011765; Sun, 01 Jul 2012 08:20:11 -0700 (PDT) Path: l9ni6432pbj.0!nntp.google.com!news2.google.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail From: AdaMagica Newsgroups: comp.lang.ada Subject: Re: GNAT and Dimension Checking Date: Sun, 1 Jul 2012 08:18:37 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: <2afdc8e6-def0-4a00-8535-4db40165fc92@googlegroups.com> NNTP-Posting-Host: 91.7.42.171 Mime-Version: 1.0 X-Trace: posting.google.com 1341156011 20428 127.0.0.1 (1 Jul 2012 15:20:11 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sun, 1 Jul 2012 15:20:11 +0000 (UTC) In-Reply-To: <2afdc8e6-def0-4a00-8535-4db40165fc92@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=91.7.42.171; posting-account=rmHyLAoAAADSQmMWJF0a_815Fdd96RDf User-Agent: G2/1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Date: 2012-07-01T08:18:37-07:00 List-Id: Thanks for the chapter - I just overlooked it. The documentation, though, is rather terse. It doesn't tell you the syntax = of the aspect clauses nor anything else than the most basic things. All in all it looks promising - it's a very clever way to use the new aspec= ts. What I found out: G : constant acceleration :=3D 127137.6 * km/(hour ** 2); Put (Sqrt (G), Aft =3D> 2, Exp =3D> 0); Put_Line (""); yields 3.13 m**(1/2).s**(-1), so it handles fractional powers (at least 1/2= ). Math functions except sqrt need dimensionless parameters. However, sin (t, t0) should be allowed as long as t and t0 have the same di= mension. It is not. Also arctan (x, y) is only allowed for dimensionless pa= rameters. We'll see how it turns out when applied to more complicated formulae, espec= ially with those where parts have fractional dimensions (in SI, there are n= o items with fractional units, but intermediate ones do). CGS cannot do without fractions. Perhaps with some refinement, this could be a theme for Ada 2020 :-) ------------------ PS: Anyone interested in dimensional arithmetics in Ada should have a look = at: Ada Europe Conference 2003 Christoph Grein, Dmitry A. Kazakov, Fraser Wilson A Survey of Physical Unit Handling Techniques in Ada The conference proceedings have appeared at Springer-Verlag: =A9 Springer-Verlag Jean-Pierre Rosen, Alfred Strohmeier (Eds) Reliable Software Technologies - Ada-Europe 2003 8th Ada-Europe International Conference on Reliable Software Technologi= es Toulouse, France, June 16-20, 2003 Proceedings Lecture Notes in Computer Science, Vol. 2655, Springer-Verlag, 2003=20 The proceedings are also available at Springer-Verlag's web site, but you n= eed to be a subscriber in order to read the full texts: http://link.springer.de/link/service/series/0558/tocs/t2655.htm or http://link.springer-ny.com/link/service/series/0558/tocs/t2655.htm For a quick overview, see http://www.christ-usch-grein.homepage.t-online.de/Ada/Dimension.html where you can also find the full paper. Have fun :-)