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.43.114.67 with SMTP id ez3mr2669338icc.6.1382193006034; Sat, 19 Oct 2013 07:30:06 -0700 (PDT) X-Received: by 10.49.71.225 with SMTP id y1mr1545qeu.31.1382193006001; Sat, 19 Oct 2013 07:30:06 -0700 (PDT) Path: border1.nntp.ams3.giganews.com!border1.nntp.ams2.giganews.com!border3.nntp.ams.giganews.com!nntp.giganews.com!news.osn.de!diablo2.news.osn.de!news.glorb.com!i2no21502406qav.0!news-out.google.com!9ni52399qaf.0!nntp.google.com!i2no21502402qav.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sat, 19 Oct 2013 07:30:05 -0700 (PDT) In-Reply-To: <0bb058fa-df1b-4092-a6f9-47d12a5f5791@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> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Possible GNAT problem with aliased parameters. From: sbelmont700@gmail.com Injection-Date: Sat, 19 Oct 2013 14:30:06 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Original-Bytes: 2542 Xref: number.nntp.dca.giganews.com comp.lang.ada:183672 Date: 2013-10-19T07:30:05-07:00 List-Id: On Saturday, October 19, 2013 1:48:58 AM UTC-4, Shark8 wrote: > now I'm trying to figure a way to do it The only way would be to hack it together with access discriminants: type Maze (n : access Maze'Class; s : access Maze'Class; e : access Maze'Class; w : access Maze'Class) is tagged null record;=20 =20 function Create (North, South, East, West : aliased in out Maze'Class:=3D N= one) return Maze is begin if Just_North then return Maze'(n =3D> North'Access, null, null, null); elsif North_And_South then return Maze'(n =3D> North'Access, South'Access, null, null); =20 -- continue a bunch more times for all possibilities =20 end if; end Create; =20 This is a shame, because the aliased parameter/access discriminant method w= orks so well for simple composition of one object, and extending it to arra= ys of objects would eliminate what is essentially the last unnecessary use = of access types (I bemoaned the inability to pass around arrays of local ac= cess types awhile back in another thread, and this is another good example = of why). -sb