comp.lang.ada
 help / color / mirror / Atom feed
* Elaboration Question
@ 2015-01-02  3:27 Hubert
  2015-01-02  7:56 ` Simon Wright
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Hubert @ 2015-01-02  3:27 UTC (permalink / raw)


For a newcomer to Ada, elaboration is one of the toughest things to 
understand. My understanding is so, that if you have for instance a 
variable in the package body, say :

A : Integer := 0;

then this variable must be initialized at some point and that's what 
elaboration does.
The problem then occurs with the order in which elaboration occurs in 
different package that depend on each other etc.
There are pragmas for the programmer to take control of the elaboration 
sequence but I have the feeling that may complicate things. especially 
when you want to make a library that should be independent and that's 
supposed to be be released to others at some point.

So may question is, is it better to just leave those variables 
unitialized and then initialize them later for instance:

A : Integer;

PROCEDURE Initialize IS
BEGIN
    A:= 0;
END Initialize;

Would that be generally better?


Thanks






---
This email has been checked for viruses by Avast antivirus software.
http://www.avast.com

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2015-01-06 20:06 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-02  3:27 Elaboration Question Hubert
2015-01-02  7:56 ` Simon Wright
2015-01-02 22:16   ` Randy Brukardt
2015-01-02 14:49 ` Brad Moore
2015-01-02 11:08   ` Mark Lorenzen
2015-01-02 13:35     ` David Botton
2015-01-02 15:11     ` sbelmont700
2015-01-02 21:57       ` Niklas Holsti
2015-01-06  2:33         ` Randy Brukardt
2015-01-06  8:17           ` Niklas Holsti
2015-01-06 20:06             ` Randy Brukardt
2015-01-03  9:45 ` Jean François Martinez
2015-01-03  9:50   ` Hubert
2015-01-03 18:43     ` Jean François Martinez
2015-01-04  1:57       ` Hubert
2015-01-04 12:05       ` Simon Wright

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