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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,8b843668b02b23b5 X-Google-Attributes: gid103376,public From: Simon Wright Subject: Re: Constructors in Ada95 Date: 2000/02/22 Message-ID: #1/1 X-Deja-AN: 588285273 X-NNTP-Posting-Host: pogner.demon.co.uk:158.152.70.98 References: X-Trace: news.demon.co.uk 951202739 nnrp-10:17583 NO-IDENT pogner.demon.co.uk:158.152.70.98 Organization: At Home Newsgroups: comp.lang.ada X-Complaints-To: abuse@demon.net Date: 2000-02-22T00:00:00+00:00 List-Id: Andy Askey writes: > I am sure this has been asked/answered several hundred times but > nothing current appears in DejaNews. Perhaps because there's a pretty full discussion in the LRM/Rationale! If you don't have access, try www.adapower.com .. with Ada.Finalization; > package pkg is > type type1 is tagged private; type Type1 is new Ada.Finalization.Controlled with private; > private > type type1 is tagged > record > i : integer := 0; > end record; type Type1 is new Ada.Finalization.Controlled with record I : Integer := 0; end record; procedure Initialize (T : in out Type1); > end pkg; > > package body pkg is > ... procedure Initialize (T : in out Type1) is begin .. end Initialize; > begin > Proc_To_Call( This_Current_Instance : in Type1'class); -- no, leave this out. > end pkg; Initialize gets called whenever an object of type Type1 is created. See also Adjust and Finalize.