comp.lang.ada
 help / color / mirror / Atom feed
From: Robert A Duff <bobduff@shell01.TheWorld.com>
Subject: Re: access assignation. Aliasing problems?
Date: Fri, 01 Feb 2008 09:02:09 -0500
Date: 2008-02-01T09:02:09-05:00	[thread overview]
Message-ID: <wccmyqkwza6.fsf@shell01.TheWorld.com> (raw)
In-Reply-To: 6766a791-abf3-4571-b5f7-98751a948f13@j78g2000hsd.googlegroups.com

Javi <fjvera@gmail.com> 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



  reply	other threads:[~2008-02-01 14:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-01 10:01 access assignation. Aliasing problems? Javi
2008-02-01 14:02 ` Robert A Duff [this message]
2008-02-01 18:24 ` Jeffrey R. Carter
2008-02-02 10:37   ` Stephen Leake
2008-02-02 21:02     ` Javi
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox