comp.lang.ada
 help / color / mirror / Atom feed
From: Jean-Pierre Rosen <rosen@adalog.fr>
Subject: Re: Initializers
Date: Wed, 20 Dec 2006 08:59:12 +0100
Date: 2006-12-20T08:59:12+01:00	[thread overview]
Message-ID: <2gqame.9rt.ln@hunter.axlog.fr> (raw)
In-Reply-To: <qfFiWcGV2v9E@eisner.encompasserve.org>

Larry Kilgallen a �crit :
> In article <1166580131.054327.67090@80g2000cwy.googlegroups.com>, "markww" <markww@gmail.com> writes:
> 
>> I'm trying to compare C++ to Ada. I'm looking specifically at Ada's
>> lack of 'initializers'. I am guessing that this means there is no
>> 'constructor' to Ada packages maybe? If that's the case - where do you
>> initialize anything that needs setup when it comes into existence?
> 
> For record components (the most common case I run into) take care of
> it in the type declaration:
> 
> 	FIELD_1 : INTEGER := 15;
> 	FIELD_2 : STRING ( 1 .. 5 ) := "Omaha";
.. And for packages, put a sequence of statement in the body of the package:

package body Blah is
   -- Declarations
begin
   -- do any initialization here
end Blah;

-- 
---------------------------------------------------------
            J-P. Rosen (rosen@adalog.fr)
Visit Adalog's web site at http://www.adalog.fr



  reply	other threads:[~2006-12-20  7:59 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-20  2:02 Initializers markww
2006-12-20  4:52 ` Initializers Larry Kilgallen
2006-12-20  7:59   ` Jean-Pierre Rosen [this message]
2006-12-20  6:57 ` Initializers Martin Krischik
2006-12-20 10:35 ` Initializers Dmitry A. Kazakov
2006-12-20 15:08 ` Initializers Georg Bauhaus
2006-12-20 20:59   ` Initializers markww
2006-12-21  5:14     ` AW: Initializers Grein, Christoph (Fa. ESG)
replies disabled

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