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,bda36258b2fe9834 X-Google-Thread: 1094ba,3354bcb01bfd8111 X-Google-Attributes: gid103376,gid1094ba,public X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news4.google.com!news.glorb.com!newsfeed-east.nntpserver.com!nntpserver.com!manticore.nntpserver.com.POSTED!teranews!not-for-mail From: Martin Krischik Subject: Re: Shortcut logicals (was: Re: F200x ) Newsgroups: comp.lang.ada,comp.lang.fortran Followup-To: comp.lang.ada,comp.lang.fortran Reply-To: martin@krischik.com References: <1107259211.c5d05dcbf8695b73b67b208313002b2b@teranews> <41ff79df$0$538$ba620e4c@news.skynet.be> Organization: None User-Agent: KNode/0.8.0 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 8Bit NNTP-Posting-Date: Tue, 01 Feb 2005 09:04:05 EST Message-ID: <1107266645.d89440009860d548c1e3d72cdc821e0c@teranews> X-Abuse-Report: http://www.usenetabuse.com X-Abuse-Notes: Abuse reports must be submited via the usenetabuse.com portal listed above. X-Abuse-Notes2: Reports sent via any other method will not be processed. X-Abuse-Notes3: Any other abuse reporting headers in this article are fraudulent. Date: Tue, 01 Feb 2005 15:03:58 +0100 Xref: g2news1.google.com comp.lang.ada:8112 comp.lang.fortran:10057 Date: 2005-02-01T15:03:58+01:00 List-Id: Adrien Plisson wrote: > Martin Krischik wrote: >> Christoph Grein wrote: >>>You'll find >>>relation and relation gives an expression, >>>relation and then relation also gives an expression. >>>But there is no syntax rule to combine an expression with a relation. >>>You can only combine a parenthesized expression (a primary) with a >>>relation. >> >> >> Sure, you are right. But that rule means that: >> >> X or Y and Z >> >> is not valid either. Not that I ever noticed - I would always use '()' on >> such a term. > > it isn't valid. GNAT 3.15p says: mixed logical operators in expression. > > See RM Introduction - design goals (�7): > "error-prone notations have been avoided" > > and this construct is error-prone (especially if you are used to code > in other languages than Ada, since each language has its own different > operator precedence). the use of parenthesis clarifies the expression > and leverages any ambiguities. I fully agree with you here - and most Ada users will do as well. I would use () in C and C++ as well - for clarity. This is of corse a cross post with comp.lang.fortran and I wonder how they see our solution to the problem. Is it suitable for Fortran 2003 as well or do they need another solution? With Regards Martin -- mailto://krischik@users.sourceforge.net http://www.ada.krischik.com