comp.lang.ada
 help / color / mirror / Atom feed
* extended return syntax bug in 2012?
@ 2012-09-18  7:43 Stephen Leake
  2012-09-18  9:14 ` Egil Høvik
  2012-09-18 16:08 ` Pascal Obry
  0 siblings, 2 replies; 7+ messages in thread
From: Stephen Leake @ 2012-09-18  7:43 UTC (permalink / 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



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

* Re: extended return syntax bug in 2012?
  2012-09-18  7:43 extended return syntax bug in 2012? Stephen Leake
@ 2012-09-18  9:14 ` Egil Høvik
  2012-09-19  1:41   ` Stephen Leake
  2012-09-18 16:08 ` Pascal Obry
  1 sibling, 1 reply; 7+ messages in thread
From: Egil Høvik @ 2012-09-18  9:14 UTC (permalink / raw)


I would say it's a bug.
The extended_return_object_declaration was introduced by this AI:
http://www.ada-auth.org/cgi-bin/cvsweb.cgi/ai05s/ai05-0277-1.txt?rev=1.3

[quote]
!corrigendum 6.5(2.1/2)

Replace the paragraph:

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

by:

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

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

As you can see, the AI still has "return" in the extended_return_statement.

-- 
~egilhh



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

* Re: extended return syntax bug in 2012?
  2012-09-18  7:43 extended return syntax bug in 2012? Stephen Leake
  2012-09-18  9:14 ` Egil Høvik
@ 2012-09-18 16:08 ` Pascal Obry
  2012-09-18 20:29   ` AdaMagica
  1 sibling, 1 reply; 7+ messages in thread
From: Pascal Obry @ 2012-09-18 16:08 UTC (permalink / raw)



Stephen,

Be sure to report to : agent@ada-auth.org

Pascal.

-- 

--|------------------------------------------------------
--| Pascal Obry                           Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--|------------------------------------------------------
--|    http://www.obry.net  -  http://v2p.fr.eu.org
--| "The best way to travel is by means of imagination"
--|
--| gpg --keyserver keys.gnupg.net --recv-key F949BD3B




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

* Re: extended return syntax bug in 2012?
  2012-09-18 16:08 ` Pascal Obry
@ 2012-09-18 20:29   ` AdaMagica
  2012-09-19  1:43     ` Stephen Leake
  0 siblings, 1 reply; 7+ messages in thread
From: AdaMagica @ 2012-09-18 20:29 UTC (permalink / raw)


On Tuesday, September 18, 2012 6:08:36 PM UTC+2, Pascal Obry wrote:
> Stephen,
> Be sure to report to : agent@ada-auth.org
It's already done.



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

* Re: extended return syntax bug in 2012?
  2012-09-18  9:14 ` Egil Høvik
@ 2012-09-19  1:41   ` Stephen Leake
  2012-09-19  4:54     ` Adam Beneschan
  0 siblings, 1 reply; 7+ messages in thread
From: Stephen Leake @ 2012-09-19  1:41 UTC (permalink / raw)


Egil Høvik <egilhovik@hotmail.com> writes:

> I would say it's a bug.
> The extended_return_object_declaration was introduced by this AI:
> http://www.ada-auth.org/cgi-bin/cvsweb.cgi/ai05s/ai05-0277-1.txt?rev=1.3

Note that you are quoting an Ada 2005 ai; I said the 'return' was in the
Ada 2005 manual. It is missing in the Ada 2012 manual.

-- 
-- Stephe



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

* Re: extended return syntax bug in 2012?
  2012-09-18 20:29   ` AdaMagica
@ 2012-09-19  1:43     ` Stephen Leake
  0 siblings, 0 replies; 7+ messages in thread
From: Stephen Leake @ 2012-09-19  1:43 UTC (permalink / raw)


AdaMagica <christ-usch.grein@t-online.de> writes:

> On Tuesday, September 18, 2012 6:08:36 PM UTC+2, Pascal Obry wrote:
>> Stephen,
>> Be sure to report to : agent@ada-auth.org
> It's already done.

Ok, I guess it is a documentation bug.

Thanks for reporting it. I guess it's not too late for this sort of fix.

I would have sent it there first, but I just couldn't believe I wasn't
missing something!

-- 
-- Stephe



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

* Re: extended return syntax bug in 2012?
  2012-09-19  1:41   ` Stephen Leake
@ 2012-09-19  4:54     ` Adam Beneschan
  0 siblings, 0 replies; 7+ messages in thread
From: Adam Beneschan @ 2012-09-19  4:54 UTC (permalink / raw)


On Tuesday, September 18, 2012 6:41:02 PM UTC-7, Stephen Leake wrote:
> Egil Høvik writes:
> 
> 
> 
> > I would say it's a bug.
> 
> > The extended_return_object_declaration was introduced by this AI:
> 
> > http://www.ada-auth.org/cgi-bin/cvsweb.cgi/ai05s/ai05-0277-1.txt?rev=1.3
> 
> Note that you are quoting an Ada 2005 ai; I said the 'return' was in the
> Ada 2005 manual. It is missing in the Ada 2012 manual.

Ada 2005 AI's are issues with Ada 2005, not issues with earlier language versions that are corrected in Ada 2005.  Or, sometimes, they're issues with earlier Ada 2005 AI's.  In this particular case, an issue with another Ada 2005 AI resulted in the syntax of extended_return_statement being changed (it now involves an extended_return_object_declaration), a change that went into Ada 2012, and something got dropped when making the change even though the rest of the change got added to Ada 2012.  Hope that helps explain things.

                             -- Adam



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

end of thread, other threads:[~2012-09-21  1:14 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-18  7:43 extended return syntax bug in 2012? Stephen Leake
2012-09-18  9:14 ` 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

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