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-Thread: 103376,e01fe1b326df26d4 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!newsfeed2.dallas1.level3.net!news.level3.com!newsfeed-00.mathworks.com!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Division by zero Date: 29 Jun 2005 12:07:48 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <79ahr0jozmqb$.10jzllrcjpmsv.dlg@40tude.net> <_pwre.7121$U4.1023104@news.xtra.co.nz> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls4.std.com 1120061268 10224 192.74.137.71 (29 Jun 2005 16:07:48 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Wed, 29 Jun 2005 16:07:48 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: g2news1.google.com comp.lang.ada:11737 Date: 2005-06-29T12:07:48-04:00 List-Id: "Dmitry A. Kazakov" writes: > On Wed, 29 Jun 2005 17:50:43 +1200, Lurker wrote: > > > "Robert A Duff" wrote in message > > news:wccy88ugorw.fsf@shell01.TheWorld.com... > > > >> 11.6(5) is all about run time effects. If divide by zero were illegal > >> (which means at compile time), then 11.6 would not apply. > > > > Which brings us back to my original question - why is it legal? > > Because within *one* type [Integer in this case] it is a halting problem: > > declare > A : Integer := 1; > B : Integer; > begin > if HALT (x) then > B := 0; > else > B := 1; > end if; > A := A / B; > end; Sorry, but I think you were confused by my sloppy wording. The question was not whether divide-by-zero should be illegal in the general case. The question was whether X/Y should be illegal when Y is static, but X is not. Even in your example above, there's a good argument that the compiler should (optionally) warn. That example looks buggy to me! - Bob