comp.lang.ada
 help / color / mirror / Atom feed
From: "Ayende Rahien" <Dont@spam.me>
Subject: Re: Problem understanding procedure Adjust(.
Date: Sun, 8 Apr 2001 14:04:40 +0200
Date: 2001-04-08T14:04:40+02:00	[thread overview]
Message-ID: <9aps7e$2g5$2@taliesin.netcom.net.uk> (raw)
In-Reply-To: 3ACFCCC6.9B4C9162@acm.org


"Jeffrey Carter" <jrcarter@acm.org> wrote in message
news:3ACFCCC6.9B4C9162@acm.org...
> Ayende Rahien wrote:
> >
> > As far as I understand, this procedure [Adjust] is called if I do
assignment on
> > stacks (which is what this package is about).
> > If I got it correctly, when I do:
> > stack1 := stack2;
> > The Adjust procedure will be called.
>
> To fully understand what happens here (assignment to a variable of a
> controlled type), first Finalize is called with Stack1 as its actual
> parameter ("Stack1 is finalized."). The Stack2's bit pattern is copied
> into Stack1's memory space ("assignment"). Then Adjust is called with
> Stack1 as its actual parameter ("Stack1 is adjusted.").
>
> So, it the stack type is implemented as a dynamically allocated linked
> list, Finalize would free the list, one node at a time. After
> assignment, both stacks would point at the same linked list. Adjust
> would then make a deep copy of Stack2's linked list for Stack1 to point
> at.

Thanks, that help understanding it.





      reply	other threads:[~2001-04-08 12:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-04-07 13:28 Problem understanding procedure Adjust( Ayende Rahien
2001-04-07 13:45 ` Mark Biggar
2001-04-07 13:51   ` Ayende Rahien
2001-04-08  2:28 ` Jeffrey Carter
2001-04-08 12:04   ` Ayende Rahien [this message]
replies disabled

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