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

In article <6tejfi$7pm$1@nnrp1.dejanews.com> dewarr@my-dejanews.com writes:

  > 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.

    Sorry, the particular case of general interest that was identified
was for a type which did not have ANY fixed*fixed or fixed/fixed
operators.  Yes, everyone has known about the overloading problem.  But
a type with no predefined multiply and divide operations (other than
those for Integer) seems a lot easier to create.

  > 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.

    Why not?  RM 3.5.6(8) seems very clear:  "An implementation may
place arbitrary restrictions on the use of such types; it is
implementation defined whether operators that are predefined for 'any
real type' are defined for a a particular nonstandard real type."  I
guess you could argue that the operations to be disallowed are of type
_universal_fixed_, but really we are talking about disallowing the
implicit conversions to _universal_fixed_ for these nonstandard types.

  > 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).

    Sounds reasonable.  This is as you point out, purely a language
extension.  Actually, I personally think the right idea is to add
such a rule to 8.6(29).  This might be a good case for a non-binding
AI, to be made binding if and when it is widely supported.
--

					Robert I. Eachus

with Standard_Disclaimer;
use  Standard_Disclaimer;
function Message (Text: in Clever_Ideas) return Better_Ideas is...




      reply	other threads:[~1998-09-17  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       ` dewarr
1998-09-12  0:00         ` Paul Whittington
1998-09-14  0:00           ` Al Christians
1998-09-14  0:00           ` dewarr
1998-09-15  0:00             ` Paul Whittington
1998-09-15  0:00               ` Peter Hermann
1998-09-15  0:00                 ` dewarr
1998-09-15  0:00               ` Markus Kuhn
1998-09-11  0:00       ` dennison
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
1998-09-17  0:00           ` Robert I. Eachus [this message]
replies disabled

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