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,LOTS_OF_MONEY autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 103376,faeb0c2550699cee X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-12-16 18:01:12 PST Path: archiver1.google.com!news2.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!gestalt.direcpc.com!cyclone2.usenetserver.com!news.webusenet.com!news-hub.cableinet.net!blueyonder!internal-news-hub.cableinet.net!news-binary.blueyonder.co.uk.POSTED!53ab2750!not-for-mail User-Agent: Microsoft-Entourage/10.1.1.2418 Subject: Re: controlled initialization From: Bill Findlay Newsgroups: comp.lang.ada Message-ID: References: <3DFD7B15.9050800@mbank.com.ua> <1040049195.294541@master.nyc.kbcfp.com> <1ec946d1.0212161526.7eb81067@posting.google.com> Mime-version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-transfer-encoding: 8bit Date: Tue, 17 Dec 2002 02:00:54 +0000 NNTP-Posting-Host: 80.195.52.70 X-Complaints-To: abuse@blueyonder.co.uk X-Trace: news-binary.blueyonder.co.uk 1040090462 80.195.52.70 (Tue, 17 Dec 2002 02:01:02 GMT) NNTP-Posting-Date: Tue, 17 Dec 2002 02:01:02 GMT Organization: blueyonder (post doesn't reflect views of blueyonder) Xref: archiver1.google.com comp.lang.ada:31933 Date: 2002-12-17T02:00:54+00:00 List-Id: On 17/12/02 01:50, in article DpvL9.30910$4W1.11730@nwrddc02.gnilink.net, "Hyman Rosen" wrote: > > 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; > We don�t need O to be deferred, or T to derive from Controlled, for that sort of construction to fail, unfortunately. All that's necessary is to call a function defined in the body of P during the elaboration of P's spec. This makes hiding the manufacture of exported ADT constants somewhat problematic. -- Bill-Findlay chez blue-yonder.co.uk ("-" => "")