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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,f0be8eebb2993001 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!feeder.news-service.com!newsfeed00.sul.t-online.de!t-online.de!inka.de!rz.uni-karlsruhe.de!news.gnuher.de!news.enyo.de!not-for-mail From: Florian Weimer Newsgroups: comp.lang.ada Subject: Re: Ada 2012 : aliased parameters ? Date: Tue, 29 Mar 2011 20:22:51 +0200 Message-ID: <87lizxiy6c.fsf@mid.deneb.enyo.de> References: <8adad214-6381-4296-9097-878fbb517f6e@k7g2000yqj.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ruchba.enyo.de 1301422971 30962 172.17.135.6 (29 Mar 2011 18:22:51 GMT) X-Complaints-To: news@enyo.de Cancel-Lock: sha1:2SYv3vjxfqNcdZlSs98/OJ4XWxw= Xref: g2news2.google.com comp.lang.ada:19550 Date: 2011-03-29T20:22:51+02:00 List-Id: * AdaMagica: > Aliased parameters are meant to cure a deficiency in e.g. containers. > With current Ada, it's awkward to replace an element of a container. > > Now if you make the curser an aliased parameter, the function result > may dereference safely the cursor, since the cursor and the result are > tightly coupled, But this is already the case in Ada 2005. The lifetime of passed-in objects extends beyond the immediate need for evaluating the expression: | Leaving an execution happens immediately after its completion, | except in the case of a _master_: the execution of a body other than | a package_body; the execution of a statement; or the evaluation of | an expression, function_call, or range that is not part of an | enclosing expression, function_call, range, or simple_statement | other than a simple_return_statement. This is from 7.6.1(3/2). I've written experimental code which depends on this, providing a syntactically convenient and efficient form of variadic subprograms.