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.182.95.68 with SMTP id di4mr4950472obb.4.1382283196237; Sun, 20 Oct 2013 08:33:16 -0700 (PDT) X-Received: by 10.182.33.4 with SMTP id n4mr127967obi.9.1382283196078; Sun, 20 Oct 2013 08:33:16 -0700 (PDT) Path: border1.nntp.dca3.giganews.com!backlog4.nntp.dca3.giganews.com!border4.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!o2no15768236qas.0!news-out.google.com!9ni58915qaf.0!nntp.google.com!i2no23311982qav.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sun, 20 Oct 2013 08:33:15 -0700 (PDT) In-Reply-To: <2f2f46da-e6c2-4e0c-a5d2-3859975b67c9@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=206.53.78.59; posting-account=ShYTIAoAAABytvcS76ZrG9GdaV-nXYKy NNTP-Posting-Host: 206.53.78.59 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> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <7ce0c2bc-7720-4a90-a31e-e723a9e47d4b@googlegroups.com> Subject: Re: Possible GNAT problem with aliased parameters. From: sbelmont700@gmail.com Injection-Date: Sun, 20 Oct 2013 15:33:16 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Received-Bytes: 2323 X-Original-Bytes: 2533 Xref: number.nntp.dca.giganews.com comp.lang.ada:183681 Date: 2013-10-20T08:33:15-07:00 List-Id: As long as you are onto the heap anyway, why not just make the client creat= e the array (with items on the heap) save a reference to that, and avoid al= l the headaches? type Paths is array (Positive range <>) of Maze_Ptr; type Maze (p : access constant Paths) is ... function Create (x : aliased Paths) is begin return Maze'(p =3D> x'access); end Create; The use case I would like is essentially this, with some magic feature that= lets you satisfy the accessibility check for local values since the code i= s obviously not creating dangling pointers. After all, you can pass pointe= rs safely by themselves (access parameters) and nested within a record (acc= ess discriminant), so there ought to be some mechanism that allows you to p= ass them around safely within an array, if for no other reason that consist= ency. -sb