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!news3.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!news.xtra.co.nz!53ab2750!not-for-mail From: "Lurker" Newsgroups: comp.lang.ada References: <79ahr0jozmqb$.10jzllrcjpmsv.dlg@40tude.net><_pwre.7121$U4.1023104@news.xtra.co.nz> Subject: Re: Division by zero X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1437 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 Message-ID: Date: Wed, 29 Jun 2005 22:40:26 +1200 NNTP-Posting-Host: 219.88.80.248 X-Complaints-To: abuse@xtra.co.nz X-Trace: news.xtra.co.nz 1120041419 219.88.80.248 (Wed, 29 Jun 2005 22:36:59 NZST) NNTP-Posting-Date: Wed, 29 Jun 2005 22:36:59 NZST Organization: Xtra Xref: g2news1.google.com comp.lang.ada:11725 Date: 2005-06-29T22:40:26+12:00 List-Id: "Christoph Grein" wrote in message news:mailman.114.1120039635.17633.comp.lang.ada@ada-france.org... > declare > C: constant := 0; > D: constant := 1; > A: constant Integer := D / C; -- static, illegal > function "/" (Left, Right: Integer) return Integer is > begin > return 1; > end "/"; > E: constant := D / C; -- static, illegal > F: constant Integer := D / C; -- legal, not static, uses overridden "/" > begin > null; > end; Well, first of all, redefinition of "/" was not permitted (or there would be no point) But more to the issue, I have said that the problem was the use of default division operator on an integer number. Yes, I can write any sorts of custom functions called "/" too. So what? The question was if or when compiler should catch trivial mistakes like that and, at least, warn you "Are you sure?"