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: "Matthew Heaney" Subject: Re: meaning of "current instance" Date: 1999/11/12 Message-ID: <382cc06a_2@news1.prserv.net>#1/1 X-Deja-AN: 547977434 Content-transfer-encoding: 7bit References: <382c0d0f_1@news1.prserv.net> Content-Type: text/plain; charset="US-ASCII" X-Complaints-To: abuse@prserv.net X-Trace: 13 Nov 1999 01:35:38 GMT, 32.101.8.122 Organization: Global Network Services - Remote Access Mail & News Services Mime-version: 1.0 Newsgroups: comp.lang.ada Date: 1999-11-12T00:00:00+00:00 List-Id: In article , tmoran@bix.com wrote: > Is it legal, or is it not? It doesn't matter if it's legal. Don't do it. > 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. See 3.10.2 (24). > 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. No. Using the "current instance" of the type is *very* common. It's how we implement multiple inheritance in Ada95: type Digital_Clock (Timer : access Timer_Type) is new Limited_Controlled with record Hour_Observer : Hour_Observer_Type (Digital_Clock'Access); Min_Observer : Min_Observer_Type (Digital_Clock'Access); Sec_Observer : Sec_Observer_Type (Digital_Clock'Access); end record; (Type Digital_Clock effectively has 4 parent types.) -- Get the FAQs about evolution and creationism.