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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.52.69.198 with SMTP id g6mr4745777vdu.6.1382315376433; Sun, 20 Oct 2013 17:29:36 -0700 (PDT) X-Received: by 10.49.48.38 with SMTP id i6mr408430qen.4.1382315376407; Sun, 20 Oct 2013 17:29:36 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!news.glorb.com!i2no23996499qav.0!news-out.google.com!9ni62895qaf.0!nntp.google.com!i2no23996497qav.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sun, 20 Oct 2013 17:29:36 -0700 (PDT) In-Reply-To: <7ce0c2bc-7720-4a90-a31e-e723a9e47d4b@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=97.123.228.141; posting-account=lJ3JNwoAAAAQfH3VV9vttJLkThaxtTfC NNTP-Posting-Host: 97.123.228.141 References: <9bc1be39-4377-4df5-8686-786babc756d1@googlegroups.com> <12afac91-f0f3-4f89-ac0f-a61aaf7b8d4b@googlegroups.com> <0bb058fa-df1b-4092-a6f9-47d12a5f5791@googlegroups.com> <28e86e6c-f2e1-4cca-abce-cd6f73447f4d@googlegroups.com> <2f2f46da-e6c2-4e0c-a5d2-3859975b67c9@googlegroups.com> <7ce0c2bc-7720-4a90-a31e-e723a9e47d4b@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Possible GNAT problem with aliased parameters. From: Shark8 Injection-Date: Mon, 21 Oct 2013 00:29:36 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:17487 Date: 2013-10-20T17:29:36-07:00 List-Id: On Sunday, October 20, 2013 9:33:15 AM UTC-6, sbelm...@gmail.com wrote: > As long as you are onto the heap anyway, why not just make the client cre= ate the array (with items on the heap) save a reference to that, and avoid = all the headaches? For what I'm doing the main use-case is reading from a text-file, building = the structures, and passing that out to some game-"engine"/interface. -- I = just wanted/needed a way to create the objects programatically to ensure th= e read/write are correct, and it seemed odd that the aliased parameters wer= en't working as expected. > The use case I would like is essentially this, with some magic feature th= at lets you satisfy the accessibility check for local values since the code= is obviously not creating dangling pointers. After all, you can pass poin= ters safely by themselves (access parameters) and nested within a record (a= ccess discriminant), so there ought to be some mechanism that allows you to= pass them around safely within an array, if for no other reason that consi= stency. Interesting; I _think_ the reason that the access-discriminant works is tha= t the record itself has a deeper level than the access, thus when the recor= d leaves scope the access may or may not be viable: the access could have t= he same scope as the record, or the record nested inside the scope declarin= g the access.