comp.lang.ada
 help / color / mirror / Atom feed
From: "Jeffrey R. Carter" <spam.jrcarter.not@acm.nospam.org>
Subject: Re: Unary operator after binary operator: legal or not?
Date: Tue, 31 Jul 2007 21:52:24 GMT
Date: 2007-07-31T21:52:24+00:00	[thread overview]
Message-ID: <raOri.29845$Xa3.14731@attbi_s22> (raw)
In-Reply-To: <1185841331.637593.83960@x40g2000prg.googlegroups.com>

Adam Beneschan wrote:
> 
> I think that was a deliberate decision.  See the BNF in 4.4.  The
> operands of "and", "and then", "or", "or else", "xor", "in", or
> relational operators are <simple_expression>.  The definition of a
> <simple_expression> is
> 
>   [unary_adding_operator] term {binary_adding_operator term}
> 
> A unary_adding_operator is part of the syntax of <simple_expression>
> but not of <term>, so the consequences is that the right operator of a
> binary_adding_operator (or a multiplying_operator, or "**" or "abs" or
> "not") can't start with a unary adding operator, unless you
> parenthesize it.  But the right operand of a relational operator or
> one of the logical operators I listed above *can* start with a unary
> adding operator.

I missed that. I knew logical and relational operators were separated 
from other binary operators to get reasonable precedence behavior, but 
didn't remember they had special syntax rules to allow this.

And "abs" and "not" ARE permitted after binary adding and multiplying 
operators, further confusing the issue.

I'd think being consistent would be be preferable.

-- 
Jeff Carter
"All citizens will be required to change their underwear
every half hour. Underwear will be worn on the outside,
so we can check."
Bananas
29



  reply	other threads:[~2007-07-31 21:52 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-30 22:52 Unary operator after binary operator: legal or not? Jeffrey R. Carter
2007-07-30 23:39 ` Markus E.L.
2007-07-31  0:22 ` Adam Beneschan
2007-07-31 21:52   ` Jeffrey R. Carter [this message]
2007-07-31  8:01 ` anon
2007-07-31  8:16   ` Unary operator after binary operator: legal or not? => Compiler Error anon
2007-07-31  8:38     ` AW: Unary operator after binary operator: legal or not? => CompilerError Grein, Christoph (Fa. ESG)
2007-07-31 15:05     ` Unary operator after binary operator: legal or not? => Compiler Error Robert A Duff
2007-07-31 15:39       ` Dmitry A. Kazakov
2007-07-31 15:53         ` Robert A Duff
2007-07-31 17:02           ` Georg Bauhaus
2007-07-31 19:17             ` Adam Beneschan
2007-08-01  7:16               ` Maciej Sobczak
2007-08-01 15:23                 ` Adam Beneschan
2007-07-31 20:59             ` Robert A Duff
2007-08-01  7:24               ` Georg Bauhaus
2007-08-01  8:02                 ` Dmitry A. Kazakov
2007-08-01  8:17                   ` AW: Unary operator after binary operator: legal or not? => CompilerError Grein, Christoph (Fa. ESG)
2007-08-01 10:10                     ` Ian Clifton
2007-08-01  9:34                   ` Unary operator after binary operator: legal or not? => Compiler Error Georg Bauhaus
2007-08-01 21:51                 ` Jeffrey R. Carter
2007-07-31 17:52           ` Dmitry A. Kazakov
2007-08-02 20:44           ` Charles Lindsey
2007-08-03  7:48             ` Stuart
2007-08-03  7:51             ` Dmitry A. Kazakov
2007-07-31 23:22     ` anon
2007-08-01  0:13       ` Adam Beneschan
2007-08-01  6:20         ` Unary operator after binary operator: legal or not? => Illegal anon
2007-08-01  5:34       ` AW: Unary operator after binary operator: legal or not? => CompilerError Grein, Christoph (Fa. ESG)
2007-08-01  6:46         ` To := Grein, Christoph (Fa. ESG) anon
2007-08-01  7:11           ` AW: " Grein, Christoph (Fa. ESG)
2007-08-02  6:52             ` anon
2007-08-02  8:56               ` AW: " Grein, Christoph (Fa. ESG)
2007-08-02 22:29                 ` Markus E.L. 2
2007-08-02 23:02                   ` tmoran
2007-08-02 23:11                     ` Ed Falis
2007-08-02 23:34                     ` Markus E.L. 2
2007-08-03  4:42                   ` AW: " Grein, Christoph (Fa. ESG)
2007-08-02 22:28               ` Markus E.L. 2
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox