comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: begin clause in package bodies
Date: Fri, 1 Dec 2017 16:52:48 +0100
Date: 2017-12-01T16:52:48+01:00	[thread overview]
Message-ID: <ovrtsh$bia$1@gioia.aioe.org> (raw)
In-Reply-To: 8c6a8a64-0ae5-4fcc-8756-3aab7c3ed508@googlegroups.com

On 2017-12-01 16:15, Mehdi Saada wrote:

> Such global variables can be corrupted by one program in a 
> unforeseen way, and corrupt another program using/reading it.
No, they cannot. Package elaboration is guaranteed to happen before its 
first use. It means that any outside access will happen after the 
package initialization. Once initialization is done it is done. 
Initialization is not a "variable", global or local.

Furthermore the term "global" does not quite apply to Ada. Ada has 
nested scopes and a variable may exist in any scope starting from the 
local one up to the library level. This also applies to task objects.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

  reply	other threads:[~2017-12-01 15:52 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-30 23:28 begin clause in package bodies Mehdi Saada
2017-12-01  0:09 ` Anh Vo
2017-12-01 10:54 ` Jeffrey R. Carter
2017-12-01 13:05 ` Mehdi Saada
2017-12-01 13:20   ` Dmitry A. Kazakov
2017-12-01 14:59   ` Simon Wright
2017-12-01 15:15     ` Mehdi Saada
2017-12-01 15:52       ` Dmitry A. Kazakov [this message]
2017-12-01 22:23         ` Randy Brukardt
2017-12-01 22:26     ` Randy Brukardt
2017-12-01 16:29   ` Jeffrey R. Carter
replies disabled

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