comp.lang.ada
 help / color / mirror / Atom feed
From: Hubert <herrdoktor@fumanchu.com>
Subject: Elaboration Question
Date: Thu, 01 Jan 2015 19:27:47 -0800
Date: 2015-01-01T19:27:47-08:00	[thread overview]
Message-ID: <Xeopw.842131$No4.595859@fx19.iad> (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

             reply	other threads:[~2015-01-02  3:27 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-02  3:27 Hubert [this message]
2015-01-02  7:56 ` Elaboration Question 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
replies disabled

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