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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,87557ce53b069315 X-Google-Attributes: gid103376,public From: tmoran@bix.com Subject: Re: meaning of "current instance" Date: 1999/11/12 Message-ID: #1/1 X-Deja-AN: 547899635 References: <382c0d0f_1@news1.prserv.net> X-Complaints-To: abuse@pacbell.net X-Trace: typhoon-sf.snfc21.pbi.net 942442258 206.170.24.51 (Fri, 12 Nov 1999 13:30:58 PST) Organization: SBC Internet Services NNTP-Posting-Date: Fri, 12 Nov 1999 13:30:58 PST Newsgroups: comp.lang.ada Date: 1999-11-12T00:00:00+00:00 List-Id: >So in your example above, it may be OK for Init to refer to component I, >because that component has definitely been elaborated. But you're >really treading on thin ice here... Is it legal, or is it not? The only mention of "current instance" of a type that I see in the LRM index is to 8.6(17), which leaves me guessing that the usual elaboration order rules apply, even though things can be written that are normally un-writeable. If the order of components in a record declaration is changed, it usually doesn't break things, or at least the compiler will point out that you are using something before it exists. A usage of "current instance" presumably is a red flag to a maintenance programmer that re-ordering is treading on thin ice. >Type T probably needs to be limited. (Did this even compile?) It compiled on two compilers, giving the results mentioned previously. Cohen's book only discusses limited T, but I don't see anything in 8.6(17) that says limited, and these two compilers don't require limited. As I read LRM 8.6(17), T.I should be just as allowable as T'access, but compilers don't seem to agree. Where is this mentioned? >You have to be careful about concurrency issues. Not in a little "junk" program testing "current instance". Stepper was intended as a standin for anything with a side effect - random numbers, IO, etc. I hope anybody writing code that might be used concurrently would use the appropriate protections, but I don't think a little test program counts.