comp.lang.ada
 help / color / mirror / Atom feed
From: "Grein, Christoph" <christoph.grein@eurocopter.com>
Subject: Re: Access to subprogram
Date: Tue, 7 May 2002 14:56:25 +0200 (MET DST)
Date: 2002-05-07T14:56:25+02:00	[thread overview]
Message-ID: <mailman.1020776341.17124.comp.lang.ada@ada.eu.org> (raw)

> 
> What is the meaning of this
> " subprogram must not be deeper than access type"

package Pak is

  type Access_P is access procedure;
  Global: Access_P;

end Pak;

with Pak;
procedure Proc is

  procedure Local is separate;
  LA: Pak.Access_P := Local'Access;

begin
  Global := LA;
end Proc;

Here Local has a deeper level than Access_P, i.e. a shorter lifetime. The 
aforementioned rule forbids such a use as LA, since Global will point to a 
non-existing item after Porc has finished.



             reply	other threads:[~2002-05-07 12:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-05-07 12:56 Grein, Christoph [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-05-07 12:47 Access to subprogram Sebastian
2002-05-07 13:01 ` David C. Hoos
2002-05-07 16:16   ` Stephen Leake
2002-05-08  6:03   ` Sebastian
replies disabled

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