comp.lang.ada
 help / color / mirror / Atom feed
From: dewarr@my-dejanews.com
Subject: Re: Fixed point design error in Ada95
Date: 1998/09/12
Date: 1998-09-12T00:00:00+00:00	[thread overview]
Message-ID: <6tejfi$7pm$1@nnrp1.dejanews.com> (raw)
In-Reply-To: EACHUS.98Sep11203812@spectre.mitre.org

In article <EACHUS.98Sep11203812@spectre.mitre.org>,
  eachus@spectre.mitre.org (Robert I. Eachus) wrote:
> In article <6tb0j5$4rg$1@nnrp1.dejanews.com> dewarr@my-dejanews.com writes:
>
>  > A pragma is obviously the wrong solution. It would be a nasty
>  > kludge at best. Pragmas are not supposed to affect the legality
>  > of programs.
>
>    I agree.  This is one of the cases that 3.5.6(8) is supposed to
> address.  The interesting thing is that Wayne Magor seems to have
> identified a case of potentially general interest.  What Wayne needs
> is a nonstandard fixed point type which corresponds to his hardware.
> But he could build that out of a nonstandard fixed type which just got
> rid of the special "*" and "/" operators.
>
>    If someone wants to do this, be sure to take advantage of Reduced
> Accuracy Subtypes from J.3:
>
>    subtype My_Fixed is Nonstandard.Fixed delta 0.125;
>
> --
>
> 					Robert I. Eachus
>
> with Standard_Disclaimer;
> use  Standard_Disclaimer;
> function Message (Text: in Clever_Ideas) return Better_Ideas is...
>

Well I would agree he has identified this case, but it is
a very well known one that has been much discussed. It is
one of the more serious incompatibilities, and worse than
that it is a case in which Ada 83 is far superior to Ada
95, there simply is no good solution to this in Ada 95.
I am not even sure Robert Eachus' solution of indtroducing
a peculiar non-standard fixed-point type is allowable from
an implementation point of view, but I am happy to leave
that issue moot, since in any case such an approach does
not help the user.

We are considering adding a pragma in GNAT that will cause
GNAT to implement the obvious solution which should have been
put into the language in the first place, namely a preference
rule that prefers a user defined operator to the implicit
one (that is only useful in limited circumstances).

I really don't see the argument against this preference rule,
it only affects programs that are currently illegal in
Ada 95, and legal in Ada 83, and gives the (desirable) Ada 83
semantics in this case.

The pragma is interesting, it is sort of a language extension
but actually no more than the Ada_83 switch (-gnat83 or
pragma Ada_83) itself. It is after all just a subset of the
effect of that switch, assuming that it does indeed handle
this case (which is true in the latest version of GNAT).

Robert Dewar
Ada Core Technologies


-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum




  reply	other threads:[~1998-09-12  0:00 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-09-09  0:00 Fixed point design error in Ada95 Wayne Magor
1998-09-10  0:00 ` Tucker Taft
1998-09-10  0:00   ` dewarr
1998-09-10  0:00     ` Wayne Magor
1998-09-12  0:00       ` dewarr
1998-09-11  0:00     ` GNAT Professional ? Mats Weber
1998-09-11  0:00       ` dennison
1998-09-11  0:00       ` dewarr
1998-09-12  0:00         ` Paul Whittington
1998-09-14  0:00           ` dewarr
1998-09-15  0:00             ` Paul Whittington
1998-09-15  0:00               ` Markus Kuhn
1998-09-15  0:00               ` Peter Hermann
1998-09-15  0:00                 ` dewarr
1998-09-14  0:00           ` Al Christians
1998-09-11  0:00   ` Fixed point design error in Ada95 Wayne Magor
1998-09-11  0:00     ` dewarr
1998-09-12  0:00       ` Robert I. Eachus
1998-09-12  0:00         ` dewarr [this message]
1998-09-17  0:00           ` Robert I. Eachus
replies disabled

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