comp.lang.ada
 help / color / mirror / Atom feed
From: dewarr@my-dejanews.com
Subject: Re: Fixed point design error in Ada95
Date: 1998/09/10
Date: 1998-09-10T00:00:00+00:00	[thread overview]
Message-ID: <6t93vn$g8l$1@nnrp1.dejanews.com> (raw)
In-Reply-To: Ez28q4.FJL.0.-s@inmet.camb.inmet.com

In article <Ez28q4.FJL.0.-s@inmet.camb.inmet.com>,
  stt@houdini.camb.inmet.com (Tucker Taft) wrote:
> Wayne Magor (wemagor@sym1.cca.rockwell.com_nospam) wrote:
>
> : I don't follow this newsgroup regularly, so I'm sorry if this topic has
> : been discussed to death already.
>
> : I'd like to know if there is a plan to fix the design error in Ada95 that
> : prevents user overloading of the "*" and "/" operators for fixed-point
> : types (it results in an ambiguity on the call)?
>
> No solution has been defined.  The best workaround is to use names
> other than "*" and "/" for user-defined multiply and divide operations
> for fixed-point types.  You can overload the predefined "*" and "/" for
> the type of interest with an "abstract" definition to make it less
> likely they get misused.
>
> : ... The last I heard, the
> : GNAT compiler did not implement fixed-point correctly (as per the Ada95
> : spec) so this wasn't a problem for that compiler.  Is that true?  Can
> : other compilers do the same?
>
> This seems like the wrong solution.  We did discuss various explicit
> pragmas to get Ada-83 compatible behavior, but I don't believe
> it went anywhere.
>
> : I had heard that this problem was known and was being discussed over a
> : year ago.  Was there a resolution, or is it being deferred to the next
> : version of Ada?
>
> : Is there a web site that contains Ada language issues such as this?
>
> www.adaic.org has an archive of comments.  If you have your own comments,
> you can send them to ada9x-mrt@inmet.com, where they will get logged, and
> redistributed to all interested parties once a day.  The format for
> comments is given in the Reference Manual.  You can also get yourself
> added to the "interested parties" list by sending mail to stt@inmet.com.
>
> : Also, what is the name of the Ada language maintenance committee?
>
> The Ada Rapporteur Group, which is part of ISO Working Group 9 (WG9)
>
> : Thanks,
> : Wayne.
>
> --
> -Tucker Taft   stt@inmet.com   http://www.inmet.com/~stt/
> Intermetrics, Inc.  Burlington, MA  USA
> An AverStar Company
>


The current version of GNAT Professional most certainly
implements fixed-point in a manner consistent with the RM,
and generates the very annoying ambiguities referred to
here. (it is possible that various obsolete versions of
GNAT may have done something else, but for the current
version we do not know of any errors in this area). Note
that if you use -gnat83, then of course the ambiguities
are properly suppressed.

Actually this is to be honest less annoying than you might
think. Unless you are using fixed-point as "poor man's
floating-point" [a dubious proposition now that virtually
all processors do floating-point faster than fixed-point],
it makes little sense to do something like

   function "*" (x,y : dollars_cents) return dollars_cents;

since, as in this case, there is an obvious conceptual
type error in this declaration.

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-10  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 [this message]
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           ` Al Christians
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-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
replies disabled

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