comp.lang.ada
 help / color / mirror / Atom feed
From: Victor Porton <porton@narod.ru>
Subject: Re: Does variable creation need Elaborate_Body?
Date: Wed, 15 Nov 2017 04:17:29 +0200
Date: 2017-11-15T04:17:29+02:00	[thread overview]
Message-ID: <oug83n$lk5$1@gioia.aioe.org> (raw)
In-Reply-To: oug7nc$l68$1@gioia.aioe.org

And what if we replace "V: Integer;" with "V: Integer := 11;"?

Victor Porton wrote:
> package X is
> 
>   -- pragma Elaborate_Body;
> 
>   function F return Integer;
> 
>   procedure Init;
> 
> end X;
> 
> package body X is
> 
>   V: Integer;
> 
>   function F return Integer is
>   begin
>     return V;
>   end;
> 
>   procedure Init is
>   begin
>     V := 123;
>   end;
> 
> end X;
> 
> -------------------
> 
> Does the above program need Elaborate_Body pragma for elaboration of "V:
> Integer;"?
> 
> Intuitively, "V: Integer;" does nothing. But it is a declaration which
> needs to be elaborated.
> 
> Does it elaborate correctly without Elaborate_Body?
> 
-- 
Victor Porton - http://portonvictor.org


  reply	other threads:[~2017-11-15  2:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-15  2:10 Does variable creation need Elaborate_Body? Victor Porton
2017-11-15  2:17 ` Victor Porton [this message]
2017-11-15  9:56 ` AdaMagica
replies disabled

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