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,103b407e8b68350b X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-01-16 09:19:38 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!news-out.cwix.com!newsfeed.cwix.com!newsfeed.icl.net!newsfeed.fjserv.net!nntp.theplanet.net!inewsm1.nntp.theplanet.net!zen.net.uk!news.cabal.org.uk!news-peer.gradwell.net!not-for-mail Newsgroups: comp.lang.ada From: porton@ex-code.com (Victor Porton) Date: Thu, 16 Jan 2003 21:53:08 +0500 References: Organization: Extreme Code Software (http://ex-code.com) Subject: Re: Anybody in US using ADA ? One silly idea.. Mime-Version: 1.0 X-Newsreader: knews 1.0b.1 Content-Type: text/plain; charset=us-ascii X-URL: http://www.ex-code.com/ Message-ID: <3e26e98f$0$33925$bed64819@news.gradwell.net> NNTP-Posting-Date: 16 Jan 2003 17:19:11 GMT NNTP-Posting-Host: 195.149.39.13 X-Trace: 1042737551 news.gradwell.net 33925 mail2news/195.149.39.13 X-Complaints-To: news-abuse@gradwell.net Xref: archiver1.google.com comp.lang.ada:33090 Date: 2003-01-16T17:19:11+00:00 List-Id: In article , Stephen Leake writes: > "Grein, Christoph" writes: > >> > Which is easily solved by saying: >> > Lower : constant Integer := Read; >> > Upper : constant Integer := Read; >> > subtype S is Integer range Lower..Upper; >> > >> > (Fortunately, declarations *are* elaborated in order :-) >> >> which, by RM 3.3.1(7), is the same as >> >> Lower, Upper: constant Integer := Read; > > Which is an excellent example of why declaring multiple initialized > variables in one statement is a horrible thing to do. I'd have to > check the manual to see if Read is called once or twice for this; > please never do it! So compilers need to give warnings if calling a not pure function in a "multiple-initializer". If we would be able to turn time back, we would to make this an error in Ada Standard. Oh, maybe make this an error in Ada0X despite of backward incompatibility, as almost all these cases seem to be erroneous or at least poorly coded (e.g. forgotten pragma Pure).