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!nx01.iad01.newshosting.com!newshosting.com!198.186.190.251.MISMATCH!news-out.readnews.com!transit4.readnews.com!panix!newsfeed-00.mathworks.com!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: access assignation. Aliasing problems? Date: Fri, 01 Feb 2008 09:02:09 -0500 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <6766a791-abf3-4571-b5f7-98751a948f13@j78g2000hsd.googlegroups.com> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls6.std.com 1201874529 10697 192.74.137.71 (1 Feb 2008 14:02:09 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Fri, 1 Feb 2008 14:02:09 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:fn9Ch8pDlIU0TZfq26nOn1rTmr8= Xref: g2news1.google.com comp.lang.ada:19677 Date: 2008-02-01T09:02:09-05:00 List-Id: Javi writes: > Hi again, I have some problem between access assignations. "List" has > in its definition a private access to ListNode (First, Last). Why > can't I do the assignation: L.List := L.Last ? it does produce an > "accessibilty error check". If both values are null, I can not either > do the assignation. > > ----------- > ... > procedure putItem (L : in out List; It : in ItemList) is > begin > if L.Last = null then > L.Last := new ListNode'(Item => It, next => null); > print(L.Last.Item); --DBG this prints OK, the Item was > properly assigned > L.First := L.Last; -- this fails, L.First and L.Last are both > the same type access ListNode > ... > ---------- > > > I'm very sorry because of bothering you with this simple questions, > thanks again. No need to apologize -- your question is a reasonable one. But you're more likely to get an answer if you post a complete compilable example, and explain in detail what "this fails" means. - Bob