comp.lang.ada
 help / color / mirror / Atom feed
* Units Checking is Ada - Solicitation of Comments on Standard Proposal
@ 1997-08-06  0:00 William A Whitaker
  1997-08-06  0:00 ` W. Wesley Groleau x4923
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: William A Whitaker @ 1997-08-06  0:00 UTC (permalink / raw)



I am soliciting comments on a standards proposal for units Ada
checking.  Please send comments directly to me at  -  whitaker@erols.com


There has long been discussion of using the properties of Ada for the
checking of physical units in engineering/scientific applications, with
little result.  Most often it is sketched as an example in texts, but
never brought to completion.  A full system was standardized in 1993 as
part of IEEE Std 1226.1, however the units checking portion did not
receive much as there was a non-checking primary option.

For the upgrade of IEEE Std 1226.1 (given the new number of P1446)
changes have been made to make the system more user-friendly.  Along
with more intelligent compilers and some Ada 95 features, this has
encouraged a stronger push for regular use of Ada units checking.

The Ada community is invited to comment on and make suggestions about
the proposal before it goes to ballot.  There is a brief write-up in the
form of a P1446 Issue, but the associated code has been modified to be
stand-alone Ada for this exercise.  Two trivial test programs are
provided (Test_SI and Test_Other_Units).  Please test with your
examples.

Issue:

http://www.erols.com/whitaker/iss_418.htm

Code:

http://www.erols.com/whitaker/si_check.ada

--   There is cuteness in the code such that GNAT earlier than 3.10 has
a problem.  A somewhat modified version is provided for earlier GNAT
(but comments are solicited on the full version):

http://www.erols.com/whitaker/si_gnat.ada

General P1446 Page:

http://www.erols.com/whitaker/p1446.htm


The present proposal is as follows.  There is a package SI which has the
definition of Unit as a discriminant record.  SI.Ops contains the
operations ("*", "/", etc.) as well as the conversion from Real to the
desired unit.  In a new twist, the conversion functions are defaulted to
1.0, meaning that Meter(1.0) and Meter are equivalent.  SI.Ops.Symbols
contains the unit constants for the trick above.  There are other
supporting packages for Unit_Text_IO and Unit_Conversions to/from
Other_Units ("English").  All this is based on IEEE Std 1226.1 (1983).




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~1997-08-08  0:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-08-06  0:00 Units Checking is Ada - Solicitation of Comments on Standard Proposal William A Whitaker
1997-08-06  0:00 ` W. Wesley Groleau x4923
1997-08-07  0:00 ` Mats Weber
1997-08-08  0:00   ` W. Wesley Groleau x4923
1997-08-08  0:00 ` Anonymous

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