From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,15d588b58ebcebac X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!news.glorb.com!newsgate.cistron.nl!xs4all!amsnews11.chello.com!newsfeed01.chello.at!newsfeed02.chello.at!news.hispeed.ch.POSTED!not-for-mail Message-Id: <1241851.bSEm0EZDxM@linux1.krischik.com> From: Martin Krischik Subject: Re: Initializers Newsgroups: comp.lang.ada Date: Wed, 20 Dec 2006 07:57:45 +0100 References: <1166580131.054327.67090@80g2000cwy.googlegroups.com> User-Agent: KNode/0.10.4 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Complaints-To: abuse@hispeed.ch Organization: hispeed.ch NNTP-Posting-Host: 80.218.118.14 (80.218.118.14) NNTP-Posting-Date: Wed, 20 Dec 2006 08:30:04 +0100 X-Trace: 22f884588e67cf57fd3ab04444 Xref: g2news2.google.com comp.lang.ada:7956 Date: 2006-12-20T07:57:45+01:00 List-Id: markww wrote: > Hi everyone, > > 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? You should be aware that the language features are distributed differently between namespaces/packages and classes/tagged-types in Ada/C++. Try reading: http://en.wikibooks.org/wiki/Ada_Programming/Object_Orientation http://en.wikibooks.org/wiki/Ada_Programming/Packages Mind you, the "Packages" chapter is missing the part for initialisation. Larry allready told you how to perform simple package initialisation - for more complex needs packages can have a body - just like a procedure. For tagged type you might also want to check out the package Ada.Finalisation - despise the name it also handles initialisation and copy construction. Martin -- mailto://krischik@users.sourceforge.net Ada programming at: http://ada.krischik.com