comp.lang.ada
 help / color / mirror / Atom feed
From: Charles Hixson <charleshixsn@earthlink.net>
Subject: Re: Disallowing Pre-Defined Operations
Date: 2000/03/16
Date: 2000-03-16T00:00:00+00:00	[thread overview]
Message-ID: <38D15537.B06CA311@earthlink.net> (raw)
In-Reply-To: 38D013EF.1F431E34@cadence.com

Re: Units:
mks? cgs? or English System? (And is a gallon an Imperial Gallon or a US
gallon?)  Are angles measures in degrees, radians, or mils? (etc.)

This feels like a very important issue to me, but if there is a generally
applicable solution, I still don't know it.  The closest I've come it to
defining, say, Meters to be a particular data type descended from (Numeric...
choose the appropriate flavor) that implements a toString feature.
Of course then one doesn't have the operators defined until one does something
like
function "/"(x : Meters; y : Numeric) return Meters;
et-multitudinous-cetera.

Paul Graham wrote:

> Tucker Taft wrote:
> >
> > "Charles H. Sampson" wrote:
> > > ...
> > > >You'll have to post the exact code if we're to understand what's going
> > > >on there (all of the ops declared, and the supposedly ambiguous
> > > >statement).  And the error message.
> > >
> > >      O. K., here's an example.  It's not meant to meaningful, just to
> > > show the problem, although I hope that the name for the integer variable
> > > suggests how it could be used meaningfully.  This example has been
> > The techniques using discriminants are unsatisfactory in my view,
> > and too "heavy."  VHDL has the notion of "units" built into the language,
> > and its approach should probably be evaluated.
>
> In VHDL units are mainly used for type TIME.  Things get complicated
> when you
> try to map the physical world onto unit data types.  For instance:
>
>     type time is ...
>     type distance is ...
>     type velocity is ...
>     type acceleration is ...
>     type mass is ...
>
>     function "/"(x : distance; y : time) return velocity;
>     function "/"(x : velocity; y : time) return acceleration;
>     function "*"(x : mass; y : acceleration) return force;
>     function "*"(x : force; y : distance) return work;
>     ...
>
> Anyway, you can see that the set of units and possible operations
> between units
> grows very quickly.  I wonder how big a complete physical types package
> would
> be (complete enough to represent all the equations in a physics or
> electonics
> textbook for instance)?
>
> Paul





  reply	other threads:[~2000-03-16  0:00 UTC|newest]

Thread overview: 66+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-03-10  0:00 Disallowing Pre-Defined Operations Charles H. Sampson
2000-03-09  0:00 ` Keith Thompson
2000-03-09  0:00 ` Samuel T. Harris
2000-03-12  0:00   ` Steven Hovater
2000-03-10  0:00 ` mark_biggar
2000-03-10  0:00 ` Jean-Pierre Rosen
2000-03-11  0:00   ` Tarjei Tj�stheim Jensen
2000-03-11  0:00     ` James S. Rogers
2000-03-13  0:00       ` Tarjei T. Jensen
2000-03-13  0:00     ` Robert Dewar
2000-03-13  0:00       ` Keith Thompson
2000-03-15  0:00         ` Robert Dewar
2000-03-13  0:00     ` dmitry6243
2000-03-15  0:00     ` Charles H. Sampson
2000-03-15  0:00       ` Robert Dewar
2000-03-21  0:00         ` Charles H. Sampson
2000-03-21  0:00           ` Robert Dewar
2000-03-21  0:00           ` Robert A Duff
2000-03-12  0:00   ` claveman
2000-03-12  0:00     ` Robert A Duff
2000-03-13  0:00       ` Tarjei T. Jensen
2000-03-13  0:00         ` Robert A Duff
2000-03-13  0:00         ` Robert Dewar
2000-03-15  0:00       ` Charles H. Sampson
2000-03-15  0:00         ` Tucker Taft
2000-03-15  0:00           ` Paul Graham
2000-03-16  0:00             ` Charles Hixson [this message]
2000-03-17  0:00               ` Paul Graham
2000-03-17  0:00                 ` Charles Hixson
2000-03-18  0:00                   ` Robert Dewar
2000-03-20  0:00                     ` Charles Hixson
2000-03-20  0:00                       ` Robert Dewar
2000-03-16  0:00             ` Robert Dewar
2000-03-16  0:00           ` Bryce Bardin
2000-03-16  0:00           ` Tarjei T. Jensen
2000-03-16  0:00             ` mark_biggar
2000-03-16  0:00             ` Dale Stanbrough
2000-03-17  0:00         ` Robert A Duff
2000-03-13  0:00     ` Ted Dennison
2000-03-14  0:00 ` Nick Roberts
2000-03-15  0:00   ` Robert Dewar
2000-03-17  0:00 ` William A Whitaker
2000-03-18  0:00   ` Robert Dewar
2000-03-22  0:00     ` William A Whitaker
2000-03-23  0:00       ` Robert Dewar
2000-04-06  0:00         ` Robert I. Eachus
2000-04-05  0:00           ` Marin D. Condic
2000-04-06  0:00             ` Robert Dewar
2000-04-06  0:00               ` Marin D. Condic
2000-04-07  0:00                 ` Robert Dewar
2000-04-07  0:00                   ` Marin D. Condic
2000-04-07  0:00                 ` dale
2000-04-07  0:00                   ` Marin D. Condic
2000-04-07  0:00                     ` Tarjei T. Jensen
2000-04-07  0:00                       ` Marin D. Condic
2000-04-07  0:00                         ` tmoran
2000-04-07  0:00                           ` Marin D. Condic
2000-04-08  0:00                             ` Vladimir Olensky
2000-04-08  0:00                             ` Vladimir Olensky
2000-04-08  0:00                         ` Dale Stanbrough
2000-04-10  0:00                         ` Tarjei T. Jensen
2000-04-15  0:00                         ` Niklas Holsti
2000-04-15  0:00                           ` Marin D. Condic
2000-04-09  0:00               ` Robert I. Eachus
2000-03-18  0:00   ` Robert Dewar
2000-03-18  0:00   ` Robert Dewar
replies disabled

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