From: "chris.danx" <chris.danx@ntlworld.com>
Subject: Re: Another Idea for Ada 20XX
Date: Mon, 3 Dec 2001 17:00:28 -0000
Date: 2001-12-03T17:00:28+00:00 [thread overview]
Message-ID: <8cOO7.1324$H4.241179@news2-win.server.ntlworld.com> (raw)
In-Reply-To: KoMO7.2339$Px.45566@rwcrnsc54
"Mark Lundquist" <mlundquist2@attbi.com> wrote in message
news:KoMO7.2339$Px.45566@rwcrnsc54...
>
> Yes. Units do need to be primitive.
>
> I've been thinking about this for a while too, but haven't had the chance
to
> write it up. The idea frankly never occurred to me until Ehud suggested
it
> in a post a few months back. At first I thought "that's nuts". But it
> isn't :-)...
>
> We now have type-safe programming in Ada. But there are two things
wanting:
> (1) unit-safe programming, and (2) automatic unit conversion. These
cannot
> be provided without augmenting the language. (Note: "automatic" does not
> mean "implicit", it means the compiler does the work for you).
>
> This would really complete Ada's support for scalar abstraction.
>
> "James Rogers" <jimmaureenrogers@worldnet.att.net> wrote in message
> news:3C0A5054.E74A82E7@worldnet.att.net...
> >
> [snip...]
> >
> > Possible declarative syntax might be:
> >
> > type Meters is unit range (0.0..1.0E380);
> > type Hours is unit range (0.0..9.99E30);
>
> Something like that. I don't think this is going to cut it, but you're on
> the right track.... Unit declarations need to be independent of types.
> Then a dimensioned type would be created by combining a unit with a
> representation later on, in the type definition. You need to defer the
> "binding" of a type to a unit in order to achieve the right level of
> abstraction.
> > type Speed is unit(Meters / Hours);
>
> I think the correct approach would involve declaring a unit (but not a
type)
> in terms of Meters and Hours (in your example). The programmer would want
> to call this unit "Meters_Per_Hour", not "Speed".
next prev parent reply other threads:[~2001-12-03 17:00 UTC|newest]
Thread overview: 56+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-12-02 16:01 Another Idea for Ada 20XX James Rogers
2001-12-02 16:38 ` Preben Randhol
2001-12-02 22:26 ` James Rogers
2001-12-02 21:19 ` Patrick Hohmeyer
2001-12-02 21:26 ` Lutz Donnerhacke
2001-12-02 23:49 ` Patrick Hohmeyer
2001-12-03 6:06 ` Wilhelm Spickermann
2001-12-03 8:58 ` Lutz Donnerhacke
2001-12-03 13:40 ` Thomas Koenig
2001-12-03 0:21 ` Robert C. Leif, Ph.D.
2001-12-03 0:35 ` Robert Dewar
2001-12-03 1:33 ` James Rogers
2001-12-03 12:34 ` Dirk Dickmanns
2001-12-04 19:02 ` Unit handling (was: Another Idea for Ada 20XX) Wilhelm Spickermann
2001-12-03 14:56 ` Another Idea for Ada 20XX Mark Lundquist
2001-12-03 15:12 ` Lutz Donnerhacke
2001-12-03 21:13 ` Dimensionality Checking (Ada 20XX) Nick Roberts
2001-12-04 14:00 ` Dmitry A. Kazakov
2001-12-06 19:52 ` Britt Snodgrass
2001-12-06 20:55 ` Mark Lundquist
2001-12-06 22:38 ` Wes Groleau
2001-12-06 23:12 ` Mark Lundquist
2001-12-07 14:36 ` Wes Groleau
2001-12-07 9:37 ` Dmitry A. Kazakov
2001-12-07 22:51 ` Mark Lundquist
2001-12-03 17:00 ` chris.danx [this message]
-- strict thread matches above, loose matches on Subject: below --
2001-12-02 19:51 Another Idea for Ada 20XX Gautier Write-only-address
2001-12-02 22:36 ` James Rogers
2001-12-03 12:44 ` Marc A. Criley
2001-12-03 14:29 ` Larry Kilgallen
2001-12-04 0:25 ` Marc A. Criley
2001-12-04 1:40 ` Adrian Hoe
2001-12-04 1:56 ` Larry Kilgallen
2001-12-04 16:08 ` Wes Groleau
2001-12-04 17:48 ` Larry Kilgallen
2001-12-09 23:02 ` Nick Roberts
2001-12-10 16:22 ` Stephen Leake
2001-12-10 17:11 ` Wes Groleau
2001-12-10 20:30 ` Robert C. Leif, Ph.D.
2001-12-10 20:59 ` Wes Groleau
2001-12-10 17:09 ` Wes Groleau
2001-12-10 17:32 ` Larry Kilgallen
2001-12-04 19:59 ` Vincent Marciante
2001-12-04 20:20 ` Wes Groleau
2001-12-04 22:18 ` Matthew Heaney
2001-12-06 4:14 ` Richard Riehle
2001-12-06 17:39 ` Wes Groleau
2001-12-07 0:55 ` Adrian Hoe
2001-12-07 9:01 ` Dmitry A. Kazakov
2001-12-07 11:49 ` Tarjei T. Jensen
2001-12-03 14:56 ` Mark Lundquist
2001-12-06 15:27 ` Philip Anderson
2001-12-07 22:51 ` Mark Lundquist
2001-12-10 9:01 ` Dmitry A. Kazakov
2001-12-02 21:24 Gautier Write-only-address
2001-12-03 14:56 ` Mark Lundquist
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox