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,7348b9598602fc10 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.220.230 with SMTP id pz6mr4949646pbc.3.1340401283133; Fri, 22 Jun 2012 14:41:23 -0700 (PDT) Path: l9ni8251pbj.0!nntp.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!bloom-beacon.mit.edu!newsswitch.lcs.mit.edu!nntp.TheWorld.com!.POSTED!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Limited_Controlled and out parameters Date: Fri, 22 Jun 2012 17:41:22 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <544352ec-9d9e-4f08-8629-50ef394ab846@googlegroups.com> <08532996-7c1f-4521-b1fc-41a03e26fcce@googlegroups.com> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 X-Trace: pcls6.std.com 1340401282 23706 192.74.137.71 (22 Jun 2012 21:41:22 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Fri, 22 Jun 2012 21:41:22 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:Qr0ndNqCN/uDYdCuQaBUB/0QWD8= Content-Type: text/plain; charset=us-ascii Date: 2012-06-22T17:41:22-04:00 List-Id: Adam Beneschan writes: > Can a controlled variable (or subcomponent) ever really be > uninitialized? In Ada, the concept of "uninitialized" applies only to scalars. Access types are initialized by default. And composite types have no such notion -- you can only talk about whether none, some, or all of their scalar subcomponents are initialized. > I guess it might, or it might be partly uninitialized. However, if the > controlled type has a Finalize routine that reads components of the > type, those components had darn well better not be uninitialized > garbage. Right, if scalar. >...(That is, allowing for cases where, say, a Boolean component > indicates whether other components in the record are initialized or not. > But that Boolean had better not be garbage.) Right. You can give that Boolean a default. Or you can make sure default initialization never happens, for example, by using unknown discriminants -- "(<>)". - Bob