comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: ANN: Units of measurement for Ada v 3.4 released
Date: Wed, 11 Jun 2014 11:37:13 +0200
Date: 2014-06-11T11:37:13+02:00	[thread overview]
Message-ID: <b2axcr52o4pc.1phhbhh8g04kx$.dlg@40tude.net> (raw)
In-Reply-To: 7a3c3540-323f-4dbe-b27a-cc6f89a30a39@googlegroups.com

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

  reply	other threads:[~2014-06-11  9:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-09 15:16 ANN: Units of measurement for Ada v 3.4 released Dmitry A. Kazakov
2014-06-10 19:13 ` Dan'l Miller
2014-06-11  9:37   ` Dmitry A. Kazakov [this message]
2014-06-11 18:25     ` Dan'l Miller
2014-06-11 19:32       ` Dmitry A. Kazakov
2014-06-11 20:17         ` Dan'l Miller
2014-06-11 21:29           ` Dmitry A. Kazakov
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox