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 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: ANN: Units of measurement for Ada v 3.4 released Date: Wed, 11 Jun 2014 11:37:13 +0200 Organization: cbb software GmbH Message-ID: References: <1rcdrvonn5xqi$.kavo0h1m48kk.dlg@40tude.net> <7a3c3540-323f-4dbe-b27a-cc6f89a30a39@googlegroups.com> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: QTaafVZuunHujkJPndFR7g.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Xref: news.eternal-september.org comp.lang.ada:20229 Date: 2014-06-11T11:37:13+02:00 List-Id: On Tue, 10 Jun 2014 12:13:42 -0700 (PDT), Dan'l Miller wrote: > On Monday, June 9, 2014 10:16:59 AM UTC-5, Dmitry A. Kazakov wrote: >> The library provides means to handle dimensioned values in Ada. > > Dmitry, have you ever considered expanding your library to include > integer, rational, and mixed-radix-positional-numeral-system numbers? > For example, a dozen is a commonplace unit of measure, but what to do with > the extra 2 eggs when representing 14 eggs. 1.16(6) dozens > Of course, this would be the > rational-number case (much like the a b/c functionality on Casio > calculators since the early 1980s) where there is an integer portion (a), > an integer numerator (b), and an integer denominator (c), where the > denominator would be intrinsically 12 for the dozen unit. Rational arithmetic is a different thing. If there is one, it is no problem to make it dimensioned. Likewise, vectors, arrays, matrices any other things forming or containing elements of a group. For example: http://www.dmitry-kazakov.de/ada/fuzzy.htm#4.2 Rational and fixed point dimensioned numbers have the issue of precision loss if you keep the base unit (as well as radix). There is a historic anecdote about an US B-bomber landed in USSR during WWII. It was not returned but carefully disassembled in order to copy it. That didn't work because inches were used as the "radix" all throughout the design. > Then, from there, full calendrical calculations could be added for various > currently-in-effect calendars. Political time is not a measurement unit. > Also, revealing which severe roadblocks (if any) that you hit using > Ada2012 in bringing this library to fruition as this flower blossoms would > be interesting to fix in Ada202X. It is kept compilable with Ada 2012. The things which could improve it are compile-time discriminant expressions and mandatory removal of static discriminants. I don't see them coming anytime soon in Ada. > In C++, Boost has served as a most-excllent stressor that motivates the > standardization of C++2011 and C++2014. Ada's container library existed as an independent project before it was taken as a template for the standard. > technical reports. So, Boost should not be mimicked line-by-line or > package-by-package, but the general pressure that a de facto standard > library development can bring to bear on the syntax & semantics of the > language itself can be quite valuable. It is difficult to say if language design driven by libraries is good or bad. STL influenced C++ before Boost. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de