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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ae9506fd4dcf7090 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-10-22 07:37:56 PST Newsgroups: comp.lang.ada Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!lnsnews.lns.cornell.edu!newsstand.cit.cornell.edu!news.stealth.net!news.stealth.net!nntp5.savvis.net!uunet!dfw.uu.net!ash.uu.net!world!news From: Robert A Duff Subject: Re: Concatenation and Characters User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Sender: news@world.std.com (Mr Usenet Himself) Message-ID: Date: Tue, 22 Oct 2002 14:37:32 GMT Content-Type: text/plain; charset=us-ascii References: <44hp9.807$_u6.205@nwrddc01.gnilink.net> <3DA5AE5F.3030902@attbi.com> <3DB03EF1.EE771923@mmm.com> <3DB43EB0.AAF4B38C@mmm.com> <3DB44B9C.80007@worldnet.att.net> <3DB466CB.7CE0BC59@mmm.com> <3DB4AD20.4070109@acm.org> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Organization: The World Public Access UNIX, Brookline, MA Xref: archiver1.google.com comp.lang.ada:30029 Date: 2002-10-22T14:37:32+00:00 List-Id: Jeffrey Carter writes: > Programmer Dude wrote: > > Upthread Preben Randhol wrote this: > > | with Ada.Text_IO; use Ada.Text_IO; > > | | procedure uninit is > > | A : Integer; > > | B : Integer := 2; > > | begin > > | | if A > B then > > | Put_Line ("A is greater than B"); > > | else > > | Put_Line ("B is greater than A"); > > | end if; > > | end uninit; > > Maybe my question is best stated thus: is there any correct > > implentation > > of Ada that would allow this code to run? >...The revision process for the language has backwards > compatibility as a major goal, so don't expect this to change. But it *did* change. In Ada 83, the above program was erroneous (i.e., had unpredictable behavior), whereas in Ada 95, it has a bounded error. It must print "A is greater than B" or "B is greater than A" or raise an exception. Note that the Ada compiler will also fail to detect the *other* bug in this program -- namely, the second Put_Line should print "B is greater than or equal to A". ;-) Even SPARK would fail to detect such a bug, if the bug occurred in both the code and the formal specification! - Bob