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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,ace3fca092a457cd X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!news.belwue.de!newsfeed.arcor.de!newsspool1.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Unary operator after binary operator: legal or not? => Compiler Error Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: Date: Tue, 31 Jul 2007 19:52:10 +0200 Message-ID: NNTP-Posting-Date: 31 Jul 2007 19:52:10 CEST NNTP-Posting-Host: 8196d504.newsspool3.arcor-online.net X-Trace: DXC=_RikX\75d On Tue, 31 Jul 2007 11:53:50 -0400, Robert A Duff wrote: > But don't you think: > > X * -3 > > ought to be legal (no user-defined operators in sight)? Maybe it was a typing error of: X * Y - 3 If not, then probably it is a style error: - X * 3 I find Ada's association restrictions a god idea. In earlier days C/C++ liberal policy of handling associations was a real problem. Nowadays, one gets a warning in some cases, but Ada is far stricter and for all I think that the idea of warning is itself not OK. Ideally, any program should be either legal or not. Nothing in between. Any warning is a kind of defeat in language design. Of course if we considered -3 being a literal, that would change a lot. But that would be IMO a bad idea. BTW, following the reductionist's path, what about eliminating decimal literals, introducing "." and "E" operators instead? function "." (Numerator, Denominator : Universal_Integer) return Universal_Real; (:-)) -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de