From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,e6545823a74c7c29 X-Google-Attributes: gid103376,public From: dewarr@my-dejanews.com Subject: Re: Fixed point design error in Ada95 Date: 1998/09/12 Message-ID: <6tejfi$7pm$1@nnrp1.dejanews.com>#1/1 X-Deja-AN: 390480801 References: <6t6ihg$dkn1@onews.collins.rockwell.com> <6ta5h2$e0b2@onews.collins.rockwell.com> <6tb0j5$4rg$1@nnrp1.dejanews.com> X-Http-Proxy: 1.0 x2.dejanews.com:80 (Squid/1.1.22) for client 209.73.133.253 Organization: Deja News - The Leader in Internet Discussion X-Article-Creation-Date: Sat Sep 12 19:53:21 1998 GMT Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/2.02 (OS/2; I) Date: 1998-09-12T00:00:00+00:00 List-Id: In article , 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