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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,faeb0c2550699cee X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-12-16 17:50:36 PST Path: archiver1.google.com!news2.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!arclight.uoregon.edu!wn14feed!worldnet.att.net!199.45.49.37!cyclone1.gnilink.net!spamfinder.gnilink.net!nwrddc02.gnilink.net.POSTED!53ab2750!not-for-mail From: Hyman Rosen User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.3a) Gecko/20021210 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: controlled initialization References: <3DFD7B15.9050800@mbank.com.ua> <1040049195.294541@master.nyc.kbcfp.com> <1ec946d1.0212161526.7eb81067@posting.google.com> In-Reply-To: <1ec946d1.0212161526.7eb81067@posting.google.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Date: Tue, 17 Dec 2002 01:50:27 GMT NNTP-Posting-Host: 162.83.250.34 X-Complaints-To: abuse@verizon.net X-Trace: nwrddc02.gnilink.net 1040089827 162.83.250.34 (Mon, 16 Dec 2002 20:50:27 EST) NNTP-Posting-Date: Mon, 16 Dec 2002 20:50:27 EST Xref: archiver1.google.com comp.lang.ada:31932 Date: 2002-12-17T01:50:27+00:00 List-Id: Matthew Heaney wrote: > O : constant T := (Controlled with null record); > > The problem is that the body of P hasn't elaborated at the moment when > object O is elaborated. Were Initialize to be called at the point of > elaboration of O, then Program_Error would be raised because the body > of Initialize hasn't been elaborated yet. Interesting. So (remembering that I don't know Ada) the following would be illegal as well? If it is, is there a way to do what the code obviously intends? Do I understand the issue correctly, that is that MakeT could use O? package P is type T is private; O : constant T; private type T is new Controlled with null record; function MakeT return T; O : constant T := MakeT; end P;