comp.lang.ada
 help / color / mirror / Atom feed
From: Stephen Leake <stephen_leake@stephe-leake.org>
Subject: extended return syntax bug in 2012?
Date: Tue, 18 Sep 2012 03:43:41 -0400
Date: 2012-09-18T03:43:41-04:00	[thread overview]
Message-ID: <85boh3ixn6.fsf@stephe-leake.org> (raw)

I must be missing something.

In the Ada 2005 reference manual, the extended return statement syntax
(from Annex P
http://www.adaic.org/resources/add_content/standards/05rm/html/RM-P.html)
is:

     extended_return_statement ::= 
         return defining_identifier : [aliased] return_subtype_indication [:= expression] [do
             handled_sequence_of_statements
         end return];

     return_subtype_indication ::= subtype_indication | access_definition

That clearly starts with 'return'.

However, in Ada 2012
(http://www.ada-auth.org/standards/12rm/html/RM-P.html), it is:

     extended_return_object_declaration ::= 
         defining_identifier : [aliased][constant] return_subtype_indication [:= expression]

     extended_return_statement ::= 
         extended_return_object_declaration [do
             handled_sequence_of_statements
         end return];

That starts with a defining_identifier (the return object)!

The example in 6.5 is the same in both versions:

     return Node : Cell do           -- in a function body, see *note 3.10.1:: for Cell
        Node.Value := Result;
        Node.Succ := Next_Node;
     end return;

Am I missing something, or is this a bug in the 2012 ARM?

-- 
-- Stephe



             reply	other threads:[~2012-09-21  1:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-18  7:43 Stephen Leake [this message]
2012-09-18  9:14 ` extended return syntax bug in 2012? Egil Høvik
2012-09-19  1:41   ` Stephen Leake
2012-09-19  4:54     ` Adam Beneschan
2012-09-18 16:08 ` Pascal Obry
2012-09-18 20:29   ` AdaMagica
2012-09-19  1:43     ` Stephen Leake
replies disabled

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