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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no 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,UTF8 Received: by 10.68.196.232 with SMTP id ip8mr7024191pbc.6.1340452929942; Sat, 23 Jun 2012 05:02:09 -0700 (PDT) Path: l9ni10529pbj.0!nntp.google.com!news1.google.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail From: Maciej Sobczak Newsgroups: comp.lang.ada Subject: Re: Limited_Controlled and out parameters Date: Sat, 23 Jun 2012 05:02:09 -0700 (PDT) Organization: http://groups.google.com Message-ID: <2f16226a-65fd-48d0-88d0-57259e80acf7@googlegroups.com> References: <544352ec-9d9e-4f08-8629-50ef394ab846@googlegroups.com> <08532996-7c1f-4521-b1fc-41a03e26fcce@googlegroups.com> NNTP-Posting-Host: 83.28.216.250 Mime-Version: 1.0 X-Trace: posting.google.com 1340452929 30639 127.0.0.1 (23 Jun 2012 12:02:09 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sat, 23 Jun 2012 12:02:09 +0000 (UTC) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=83.28.216.250; posting-account=bMuEOQoAAACUUr_ghL3RBIi5neBZ5w_S User-Agent: G2/1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Date: 2012-06-23T05:02:09-07:00 List-Id: W dniu pi=C4=85tek, 22 czerwca 2012 22:22:57 UTC+2 u=C5=BCytkownik Randy Br= ukardt napisa=C5=82: [...] > Since his example includes a component with an access type, it is always= =20 > included in this bullet, so the behavior of the parameter is the same for= =20 > "in out" and "out". And thus it is safe and reasonable to check if the=20 > object is already in use. Thank you very much for a thorough explanation, this now makes sense. Still, the solution does not feel very comfortable - the language seems to = be somewhat spoiled by such nuances. Is it OK to read "out" parameters? Wel= l, it depends on things that are defined far away from the place in questio= n. > (And I agree, don't make these things limited unless you really must not= =20 > allow assignment. It's not that hard to write a proper Adjust routine for= a=20 > type like this one. "Limited poisoning" is a real problem in practice.) I don't fully agree here - I would rather approach it the other way round: = start from the most limited (pun intended) set of operations and add to the= m only when necessary. Automatic call to Finalize is not necessarily what I= want to have in such places - the type in question might be much more comp= lex than what I have presented and the problematic procedure need not rewri= te the whole object. But then I would use "in out" mode to reflect the fact= that the post-call state depends on pre-call value. --=20 Maciej Sobczak * http://www.msobczak.com * http://www.inspirel.com