comp.lang.ada
 help / color / mirror / Atom feed
From: Charles Hixson <charleshixsn@earthlink.net>
Subject: Re: Operators -> unit analysis
Date: 2000/01/05
Date: 2000-01-05T00:00:00+00:00	[thread overview]
Message-ID: <3873B648.792D578@earthlink.net> (raw)
In-Reply-To: 3873a69a_1@news1.prserv.net



Matthew Heaney wrote:

> ...

> You can already do this:
>
>   Speed := Miles'(37.0) / Hours'(1.5);
>
> I always recommend type qualification for literals when units are an
> issue.
>

That handles the units problem, but the syntax is still backwards for how it needs
to be read.  I suppose there's no way out. (And I'm being picky).  But:
  Speed := Miles'(37.0) / Hours'(1.5);
is read as:
  Speed := (37.0)'Miles / (1.5)'Hours;
And even there, for a simple statement like this I would prefer:
  Speed := 37.0'Miles / 1.5'Hours;
Actually, this would probably be as near to optimal as is realizable.
But defining each unit separately has problems.  I like the general approach used
by Pat Rogers:

> I have a facility somewhat like that on the "free code page" at my web
> site:
>
> http://www.classwide.com/products/freecode.htm
>
> Look for the "dimensioned units" section (at the bottom).
>
> --
> Pat Rogers                            Training and Consulting in:
> http://www.classwide.com      Deadline Schedulability Analysis
> progers@classwide.com        Software Fault Tolerance
> (281)648-3165                       Real-Time/OO Languages
>
as it feels more "generalizeable".






  reply	other threads:[~2000-01-05  0:00 UTC|newest]

Thread overview: 77+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-12-23  0:00 Ada Brijesh
1999-12-23  0:00 ` Ada reason67
1999-12-23  0:00   ` Ada Robert Dewar
2000-01-03  0:00     ` Ada Terry Sikes
2000-01-03  0:00       ` Ada Hyman Rosen
2000-01-04  0:00         ` Ada Richard D Riehle
2000-01-04  0:00           ` Ada Hyman Rosen
2000-01-04  0:00             ` Ada Richard D Riehle
2000-01-04  0:00             ` Ada Robert A Duff
2000-01-04  0:00         ` Ada Terry Sikes
2000-01-05  0:00           ` Operators -> unit analysis Charles Hixson
2000-01-05  0:00             ` Ted Dennison
2000-01-06  0:00               ` Samuel T. Harris
2000-01-07  0:00                 ` Robert Dewar
2000-01-07  0:00                   ` Ted Dennison
2000-01-07  0:00                     ` Brian Rogoff
2000-01-07  0:00                   ` Robert A Duff
2000-01-07  0:00                     ` Matthew Heaney
2000-01-08  0:00                       ` Robert Dewar
2000-01-08  0:00                         ` Robert A Duff
2000-01-10  0:00                       ` Operator precedence--was " Howard W. LUDWIG
2000-01-14  0:00                         ` Mark A Biggar
2000-01-06  0:00               ` Charles Hixson
2000-01-05  0:00             ` Pat Rogers
2000-01-05  0:00               ` Charles Hixson
2000-01-05  0:00             ` Matthew Heaney
2000-01-05  0:00               ` Charles Hixson [this message]
2000-01-05  0:00             ` Hyman Rosen
2000-01-05  0:00               ` Matthew Heaney
2000-01-06  0:00             ` Robert Dewar
2000-01-06  0:00               ` Terry Sikes
2000-01-06  0:00                 ` Robert A Duff
2000-01-07  0:00                   ` Terry Sikes
2000-01-07  0:00                     ` Brian Rogoff
2000-01-07  0:00                 ` Ted Dennison
2000-01-07  0:00                   ` Tucker Taft
2000-01-08  0:00                     ` Robert Dewar
2000-01-10  0:00                       ` Tucker Taft
2000-01-10  0:00                         ` Florian Weimer
2000-01-04  0:00         ` Ada Florian Weimer
2000-01-04  0:00           ` Ada Brian Rogoff
2000-01-04  0:00           ` Ada Hyman Rosen
2000-01-04  0:00         ` Ada Robert Dewar
2000-01-04  0:00           ` Ada Robert A Duff
2000-01-04  0:00             ` Ada Hyman Rosen
2000-01-04  0:00           ` Ada Hyman Rosen
2000-01-04  0:00       ` Ada Robert Dewar
2000-01-04  0:00         ` Ada Terry Sikes
2000-01-05  0:00           ` Ada Robert Dewar
2000-01-05  0:00             ` Ada Terry Sikes
2000-01-06  0:00           ` Ada Al Christians
2000-01-06  0:00             ` Ada Terry Sikes
2000-01-07  0:00             ` Ada Robert Dewar
1999-12-23  0:00 ` Ada Greg Martin
1999-12-23  0:00 ` Ada Roger Racine
1999-12-28  0:00   ` Ada Marin D. Condic
1999-12-31  0:00     ` Ada Richard D Riehle
2000-01-02  0:00       ` Ada Marin D. Condic
2000-01-02  0:00         ` Ada Robert Dewar
2000-01-02  0:00           ` Ada Marin D. Condic
2000-01-03  0:00             ` Ada Ted Dennison
2000-01-03  0:00             ` Ada Robert Dewar
2000-01-03  0:00               ` Ada Marin D. Condic
2000-01-03  0:00                 ` Ada Larry Kilgallen
2000-01-04  0:00                   ` Ada Charles Hixson
2000-01-03  0:00                 ` Ada Roger Racine
2000-01-13  0:00     ` Ada Magnus Alexandersson
2000-01-14  0:00       ` Ada Tarjei T. Jensen
2000-01-14  0:00         ` Ada Larry Kilgallen
2000-01-14  0:00           ` Ada Marin D. Condic
2000-01-14  0:00             ` Ada Magnus Alexandersson
2000-01-14  0:00               ` Ada Marin D. Condic
2000-01-13  0:00     ` Ada Magnus Alexandersson
1999-12-23  0:00 ` Ada Robert Dewar
1999-12-23  0:00   ` Ada tmoran
1999-12-23  0:00 ` Ada Jon Jensen
  -- strict thread matches above, loose matches on Subject: below --
2000-01-08  0:00 Operators -> Unit Analysis mfeldman
replies disabled

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