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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,3fc1c2283df835d5 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-07-31 00:43:05 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!news-FFM2.ecrc.net!news.iks-jena.de!not-for-mail From: Lutz Donnerhacke Newsgroups: comp.lang.ada Subject: Re: Limited_Controlled types as 'out' arguments Date: Thu, 31 Jul 2003 07:43:05 +0000 (UTC) Organization: IKS GmbH Jena Message-ID: References: NNTP-Posting-Host: taranis.iks-jena.de X-Trace: branwen.iks-jena.de 1059637385 21836 217.17.192.37 (31 Jul 2003 07:43:05 GMT) X-Complaints-To: usenet@iks-jena.de NNTP-Posting-Date: Thu, 31 Jul 2003 07:43:05 +0000 (UTC) User-Agent: slrn/0.9.7.4 (Linux) Xref: archiver1.google.com comp.lang.ada:41059 Date: 2003-07-31T07:43:05+00:00 List-Id: * Randy Brukardt wrote: > "Lutz Donnerhacke" wrote in message >> which is clearly wrong in the same way. > > Of course. "in out" and "out" parameters for tagged types (and most other > types as well) are equivalent. Consider the lack of an "in" to be a comment > to the caller, not to the author of the subprogram. I thought a call "xxx(my)" to "procedure xxx (a : out Test)" is very similar to "my := xxx", if a "function xxx return Test" exists. This idea is wrong. > not be initialized (esp. if the type isn't controlled), but the object as a > whole is initialized. If it wasn't, the tag wouldn't be set, which would > make even membership operations impossible. Ack for discriminants, tags, etc. Nack for private data. So the consequence is: If you pass a controlled type as an 'out' paramenter in the type defining library unit, provide sufficient initialization for all private data, otherwise you can't distiguish uninitalized garbage from real data. >> So the only result of this can be: Do not provide 'out' Parameters to >> controlled types in the same library unit. > > No, just realize that "out" is the same as "in out" as far as the > implementation of a routine is concerned. But it still can provide useful > information to the caller. I'm going to see this, but I'm still confused.