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,c80e6f742e73478f X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!feeder.news-service.com!feeder.erje.net!news2.arglkargh.de!nuzba.szn.dk!news.jacob-sparre.dk!pnx.dk!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Ensuring postconditions in the face of exceptions Date: Mon, 15 Mar 2010 22:13:56 -0500 Organization: Jacob Sparre Andersen Message-ID: References: <820d96c0-5d67-4b8c-8c5b-811ca4f1127e@g26g2000yqn.googlegroups.com> <4b9a098b$0$2339$4f793bc4@news.tdc.fi> <3696058c-235f-4d58-87be-74172ca0248a@g4g2000yqa.googlegroups.com> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: munin.nbi.dk 1268709237 26167 69.95.181.76 (16 Mar 2010 03:13:57 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Tue, 16 Mar 2010 03:13:57 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5843 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 Xref: g2news1.google.com comp.lang.ada:9586 Date: 2010-03-15T22:13:56-05:00 List-Id: "Robert A Duff" wrote in message news:wcc7hpgckyy.fsf@shell01.TheWorld.com... > "Randy Brukardt" writes: > >> For the record, I think you mean "limited record types". There are no >> requirements on how limited private types or record types that happen to >> be >> limited because of a limited component are passed. > > Well, that needs some clarification: for example, a record containing > a task is passed by reference, even if the record doesn't explicitly > say "limited". > > The point is, the compiler looks at the full types of everything > involved when deciding whether it must pass something by reference. > So "limited private" is irrelevant. I missed a word: I meant "explicitly limited record type" (that is one that contains the word "limited" in the record declaration). That and "tagged" are the only ways to *guarantee* that a record is passed by reference. Jeff Carter writes: >Really? ARM 6.2 seems to me to say that any limited type (a type whose full >view >is limited) is passed by reference. This explicitly includes a composite >type >with a component of a limited type. You suddenly added "full view" to this, and that's the crux of the problem: "limited" is a property of a view, while "by-reference" is a property of a type. (BTW, 6.2(7) is subtly broken, see AI05-0096-1 for details if you're Adam or want to know every possible detail. :-) The point is that there are many limited types that are not required to be passed by reference, including some record types that are limited. Also note that your statement here is also subtly wrong: a record type has to be passed by reference if it has a by-reference component -- not a limited component! A component of a limited private type would make the record limited but not necessarily by-reference (read the rules carefully again). Repeat after me: "limited" is a property of a view! It's not constant for a particular type! That's a common mistake that even those of us on the ARG make from time-to-time. Randy.