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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,9768c08202fdbbb1 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-11-12 00:25:07 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!arclight.uoregon.edu!news.tufts.edu!uunet!dca.uu.net!ash.uu.net!prodigy.com!newsmst01.news.prodigy.com!prodigy.com!postmaster.news.prodigy.com!newssvr14.news.prodigy.com.POSTED!17b0e3b3!not-for-mail User-Agent: Microsoft-Outlook-Express-Macintosh-Edition/5.02.2022 Subject: Re: Let's change semantics of "use type" From: "R. Tim Coslet" Newsgroups: comp.lang.ada Message-ID: References: <3dcb8347$0$299$bed64819@news.gradwell.net> <4519e058.0211110759.3ebbf128@posting.google.com> Mime-version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit NNTP-Posting-Host: 206.170.2.189 X-Complaints-To: abuse@prodigy.net X-Trace: newssvr14.news.prodigy.com 1037089455 ST000 206.170.2.189 (Tue, 12 Nov 2002 03:24:15 EST) NNTP-Posting-Date: Tue, 12 Nov 2002 03:24:15 EST Organization: Prodigy Internet http://www.prodigy.com X-UserInfo1: FKPO@SNGAZVMR_XXKBNDM^P@VZ\LPCXLLBWLOOAFMASJETAANVW[AKWZE\]^XQWIGNE_[EBL@^_\^JOCQ^RSNVLGTFTKHTXHHP[NB\_C@\SD@EP_[KCXX__AGDDEKGFNB\ZOKLRNCY_CGG[RHT_UN@C_BSY\G__IJIX_PLSA[CCFAULEY\FL\VLGANTQQ]FN Date: Tue, 12 Nov 2002 08:24:15 GMT Xref: archiver1.google.com comp.lang.ada:30749 Date: 2002-11-12T08:24:15+00:00 List-Id: The only real use I have ever found in Ada95 for rename is when I need to make repeated references to the same array element in several places in a block of code. I rename the array element (to tell the compiler to index it only once) then use the new name in the places in the code that reference it. Example: declare Selected_Item : Some_Typ renames Big_Arrayo_of_Data(x,y,z); begin if Selected_Item = Special_Value then y := Complex_Function(Selected_Item,z); ... more code refering to Selected_Item ... end if; Selected_Item := Fancy_Function(x,i); end; Note: in the above code the change in y does NOT affect the item already indexed, so Selected_Item still refers to the same item. -- R. Tim Coslet r_tim_coslet@pacbell.net Technology, n. Domesticated natural phenomena. > From: dennison@telepath.com (Ted Dennison) > Organization: http://groups.google.com/ > Newsgroups: comp.lang.ada > Date: 11 Nov 2002 07:59:47 -0800 > Subject: Re: Let's change semantics of "use type" > > > I've done quite a bit of tagged type programming in Ada95, and I have > *never* used a rename that way. In fact, I don't believe I've used a > single rename in Ada95 ever... >