From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.4 required=5.0 tests=BAYES_00,FORGED_MUA_MOZILLA autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,bc2c82b1e5c6fe83 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.129.169 with SMTP id nx9mr2829477pbb.2.1330277543724; Sun, 26 Feb 2012 09:32:23 -0800 (PST) Path: h9ni12055pbe.0!nntp.google.com!news1.google.com!news.glorb.com!newsgate.cuhk.edu.hk!news.netfront.net!not-for-mail From: Jeffrey Carter Newsgroups: comp.lang.ada Subject: Re: Question about out parameters of unconstrained array type. Date: Sun, 26 Feb 2012 10:32:22 -0700 Organization: Also freenews.netfront.net; news.tornevall.net Message-ID: References: <4NedncPWdPN9GtTS4p2dnAA@giganews.com> <20120226132532.7fb8ec1b@t60> NNTP-Posting-Host: 70.218.232.145 Mime-Version: 1.0 X-Trace: adenine.netfront.net 1330277543 2783 70.218.232.145 (26 Feb 2012 17:32:23 GMT) X-Complaints-To: news@netfront.net NNTP-Posting-Date: Sun, 26 Feb 2012 17:32:23 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux i686; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2 In-Reply-To: <20120226132532.7fb8ec1b@t60> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Date: 2012-02-26T10:32:22-07:00 List-Id: On 02/26/2012 05:25 AM, Alexander Senier wrote: > > Can anybody comment on the legality of using attributes of an out parameter of > an unconstrained (array) type in Ada? A brief skim through LRM could not > enlighten me... ARM-83 6.2 (Formal Parameter Modes) has: out The formal parameter is a variable and permits updating of the value of the associated actual parameter. The value of a scalar parameter that is not updated by the call is undefined upon return; the same holds for the value of a scalar subcomponent, other than a discriminant. Reading the bounds and discriminants of the formal parameter and of its subcomponents is allowed, but no other reading. This explicitly allows reading the bounds of a mode-out formal array parameter (note that, in Ada 83, you could not read the value of a mode-out parameter, even after assigning to it). ARM-95 and later are more formal, and lack such a simple statement about reading attributes. Whether 'Length counts as "bounds" is another matter; 'Length is 'Pos ('Last) - 'Pos ('First) + 1, so I'd think it does. -- Jeff Carter "If you think you got a nasty taunting this time, you ain't heard nothing yet!" Monty Python and the Holy Grail 23 --- Posted via news://freenews.netfront.net/ - Complaints to news@netfront.net ---