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: g2news2.google.com!news1.google.com!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!nntp.club.cc.cmu.edu!micro-heart-of-gold.mit.edu!newsswitch.lcs.mit.edu!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Ensuring postconditions in the face of exceptions Date: Tue, 16 Mar 2010 11:18:24 -0400 Organization: The World Public Access UNIX, Brookline, MA 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: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls6.std.com 1268752698 27590 192.74.137.71 (16 Mar 2010 15:18:18 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Tue, 16 Mar 2010 15:18:18 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:5SV8nS5M4G6l38DL7MmqKsBuhbQ= Xref: g2news2.google.com comp.lang.ada:10562 Date: 2010-03-16T11:18:24-04:00 List-Id: "Randy Brukardt" writes: > "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. That's still not quite right. A record that contains a task, protected, or a tagged component is passed by ref, even if the record is not explicitly limited. See RM-6.2. > 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. ...with a component of a by-ref 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. Right. Example: record containing a component of a limited private type, whose full type is scalar. > 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. I don't understand why the definition of "by reference" is subtly different from the definition of "immutably limited". - Bob