comp.lang.ada
 help / color / mirror / Atom feed
From: Stephen Leake <stephen_leake@stephe-leake.org>
Subject: relax double parens in expression_function_declaration?
Date: Mon, 20 Feb 2017 12:52:41 -0800 (PST)
Date: 2017-02-20T12:52:41-08:00	[thread overview]
Message-ID: <864b4b14-5c42-4ddc-92ee-ad76ce2be159@googlegroups.com> (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?

             reply	other threads:[~2017-02-20 20:52 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-20 20:52 Stephen Leake [this message]
2017-02-20 21:16 ` relax double parens in expression_function_declaration? 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
replies disabled

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