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,17182d99840be79c X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!wns14feed!worldnet.att.net!attbi_s21.POSTED!53ab2750!not-for-mail From: "Jeffrey R. Carter" User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: access assignation. Aliasing problems? References: <6766a791-abf3-4571-b5f7-98751a948f13@j78g2000hsd.googlegroups.com> In-Reply-To: <6766a791-abf3-4571-b5f7-98751a948f13@j78g2000hsd.googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: NNTP-Posting-Host: 12.201.97.213 X-Complaints-To: abuse@mchsi.com X-Trace: attbi_s21 1201890268 12.201.97.213 (Fri, 01 Feb 2008 18:24:28 GMT) NNTP-Posting-Date: Fri, 01 Feb 2008 18:24:28 GMT Organization: AT&T ASP.att.net Date: Fri, 01 Feb 2008 18:24:28 GMT Xref: g2news1.google.com comp.lang.ada:19682 Date: 2008-02-01T18:24:28+00:00 List-Id: Javi wrote: > L.Last := new ListNode'(Item => It, next => null); > L.First := L.Last; -- this fails, L.First and L.Last are both > the same type access ListNode I suspect you're saying that type List has components such as type List is record First : access Listnode; Last : access Listnode; ... end record; The solution is simple: Don't use anonymous types. Use a named type instead: type Node_Ptr is access Listnode; -- Using '_' is The Ada Way. type List is record First : Node_Ptr; Last : Node_Ptr; ... end record; Anonymous types are a horrible thing and should be avoided whenever possible. -- Jeff Carter "Sir Robin the-not-quite-so-brave-as-Sir-Lancelot, who had nearly fought the Dragon of Angnor, who nearly stood up to the vicious Chicken of Bristol, and who had personally wet himself at the Battle of Badon Hill." Monty Python & the Holy Grail 68