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=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.224.130.195 with SMTP id u3mr12042432qas.1.1367511316793; Thu, 02 May 2013 09:15:16 -0700 (PDT) X-Received: by 10.182.105.10 with SMTP id gi10mr114870obb.29.1367511316589; Thu, 02 May 2013 09:15:16 -0700 (PDT) Path: border1.nntp.dca3.giganews.com!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!l3no384140qak.0!news-out.google.com!y6ni7qax.0!nntp.google.com!l3no384137qak.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Thu, 2 May 2013 09:15:16 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=66.126.103.122; posting-account=duW0ogkAAABjRdnxgLGXDfna0Gc6XqmQ NNTP-Posting-Host: 66.126.103.122 References: <97967083-d21d-4de2-aeb8-76d0d5818993@googlegroups.com> <03e84773-d616-4a46-8189-93ae4ab5fcbf@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <76761472-73ab-4869-a214-5945e9cc4a77@googlegroups.com> Subject: Re: Interresting difference in Normal-Returns/Expression-Functions and Extended-Returns. From: Adam Beneschan Injection-Date: Thu, 02 May 2013 16:15:16 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Original-Bytes: 4041 Xref: number.nntp.dca.giganews.com comp.lang.ada:181359 Date: 2013-05-02T09:15:16-07:00 List-Id: On Wednesday, May 1, 2013 7:38:29 PM UTC-7, Randy Brukardt wrote: > I don't understand. The anonymous access type is declared in the block, a= s=20 > the master of an access return is that of the point of call [it's passed= =20 > into the function if necessary]. (That's changed in Ada 2012, but the=20 > previous definition was nonsense.) That's the master of the allocators. I think I covered this in my previous response to Egil, but it doesn't appe= ar to me that the RM says this is the master of an allocated task. That's = defined in 9.3(2), which says the master of an allocated task is the master= that elaborates the anonymous access type declaration. Maybe it's the int= ent that the "anonymous access type declaration" involved here is the one i= n the block, but there are multiple anonymous access type declarations invo= lved--the one declared with the FUNCTION declaration, and the one declared = in the block--and I don't know of any reason in the RM that says the "given= access type" is one or the other. My thinking is that it should be the ob= vious one--the declaration that is referred to at the point where the alloc= ator occurs, which would be the function result type. The same problem occurs with extended return: > BTW, I don't think the extended return should be different, but I have no= =20 > interest in figuring out whether it could or not. It probably depends on= =20 > exactly how/where the allocator is written. The problem is that the extended return introduces yet a third anonymous ac= cess type declaration. Apparently you think that this shouldn't change thi= ngs, and it makes sense that it shouldn't. But the way 9.3(2) is written, = I think it does. I think the answer is just that 9.3(2) is broken and needs to be fixed. It= works fine for named access types, but leads to possibly undesirable conse= quences with anonymous access types. In fact, this rule essentially hasn't= changed since Ada 83 (RM83 9.4(2)), when of course there were no anonymous= access types. Either 9.3(2) needs to be rewritten to specify exactly what= is supposed to happen when an allocator for an anonymous access type creat= es a task, or it should just be illegal to use an allocator for an anonymou= s-access-to-task (or to a type containing a task). I wouldn't be opposed t= o the latter alternative. It wouldn't be backward compatible, but at least= it would accomplish this purpose: > No human can figure these things out, so please don't use them and save t= he=20 > brain of an ARG member. ;-) -- Adam