comp.lang.ada
 help / color / mirror / Atom feed
* relax double parens in expression_function_declaration?
@ 2017-02-20 20:52 Stephen Leake
  2017-02-20 21:16 ` Simon Wright
  2017-02-20 22:03 ` Randy Brukardt
  0 siblings, 2 replies; 9+ messages in thread
From: Stephen Leake @ 2017-02-20 20:52 UTC (permalink / raw)


Recent GNAT allows this:

   type Result is record
      A : Integer;
      B : Integer;
   end record;

   function Key return Result is
     (A => 1,
      B => 2);

However, I can't find a rule in the ARM that allows it.
ARM 6.8 says:

   expression_function_declaration ::=
        [overriding_indicator]
        function_specification is
            (expression)
            [aspect_specification];

This requires double parens:

   function Key return Result is
     ((A => 1,
       B => 2));

ARM 4.5.7(7) gives permission to remove the double parens for conditional_expression; is there a similar rule or AI for aggregates?

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

end of thread, other threads:[~2017-02-22 23:00 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-20 20:52 relax double parens in expression_function_declaration? Stephen Leake
2017-02-20 21:16 ` Simon Wright
2017-02-20 22:11   ` Randy Brukardt
2017-02-21 15:38     ` Simon Wright
2017-02-20 22:03 ` Randy Brukardt
2017-02-21 12:15   ` Stephen Leake
2017-02-21 20:03     ` Randy Brukardt
2017-02-22 13:12       ` Georg Bauhaus
2017-02-22 23:00         ` Randy Brukardt

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