comp.lang.ada
 help / color / mirror / Atom feed
* Parentheses around conditional/quantified expressions
@ 2012-10-08 11:26 Georg Bauhaus
  2012-10-08 12:51 ` Marc C
  0 siblings, 1 reply; 2+ messages in thread
From: Georg Bauhaus @ 2012-10-08 11:26 UTC (permalink / raw)


The following source text is not accepted by GNAT:

package Instance is new Generic (for Some J in 1 .. 10 => True);

where generic package Generic has a single Boolean formal
parameters. GNAT says, "quantified expression must be parenthesized"
Are parentheses needed, or does GNAT just not support this case yet?

LRM 4.5.7 and 4.5.8 say, respectively,

"Wherever the Syntax Rules allow an expression,
 a conditional_expression may be used in place of the expression,
 so long as it is immediately surrounded by parentheses."

"Wherever the Syntax Rules allow an expression,
 a quantified_expression may be used in place of the expression,
 so long as it is immediately surrounded by parentheses."

GNAT does accept:

package Instance is new Generic ((for Some J in 1 .. 10 => True));



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Parentheses around conditional/quantified expressions
  2012-10-08 11:26 Parentheses around conditional/quantified expressions Georg Bauhaus
@ 2012-10-08 12:51 ` Marc C
  0 siblings, 0 replies; 2+ messages in thread
From: Marc C @ 2012-10-08 12:51 UTC (permalink / raw)


On Monday, October 8, 2012 6:26:06 AM UTC-5, Georg Bauhaus wrote:
> The following source text is not accepted by GNAT:
> 
> package Instance is new Generic (for Some J in 1 .. 10 => True);
> 
> where generic package Generic has a single Boolean formal
> parameters. GNAT says, "quantified expression must be parenthesized"
> Are parentheses needed, or does GNAT just not support this case yet?

> GNAT does accept:
> 
> package Instance is new Generic ((for Some J in 1 .. 10 => True));

I can't speak to the validity of this construct, but if it does turn out to be valid code that GNAT is rejecting, report it to them. Even as an unsupported user they'll accept bug reports, and *may* respond.

AdaCore has conceded that some of the 2012 features implemented in GNAT GPL 2012  have some bugs (http://identi.ca/conversation/94802814#notice-95432414), though everything I've reported so far they've said has been fixed in their current baseline. Just gotta wait for GNAT GPL 2013 :-)

Marc A. Criley



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-10-16  1:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-08 11:26 Parentheses around conditional/quantified expressions Georg Bauhaus
2012-10-08 12:51 ` Marc C

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