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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,8c350c9f790688d X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2004-02-13 12:33:10 PST Path: archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!crtntx1-snh1.gtei.net!news.gtei.net!newsfeed1.easynews.com!easynews.com!easynews!border1.nntp.sjc.giganews.com!nntp.giganews.com!local1.nntp.sjc.giganews.com!nntp.comcast.com!news.comcast.com.POSTED!not-for-mail NNTP-Posting-Date: Fri, 13 Feb 2004 14:33:08 -0600 Date: Fri, 13 Feb 2004 15:33:08 -0500 From: "Robert I. Eachus" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: renames and access References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: NNTP-Posting-Host: 24.147.77.160 X-Trace: sv3-61wJnsQNU6HHOv8QkXasrFzNSKcm/svcHPRnMYekEyesgHSI54HNfXVRIhSGDqkkJIhyCH1ytx3fshU!2UrdD3PwC3bsqOHFEJS0pUlb75UC5cYp2LvHKoiNVA9N7sI27AqSy/+m4xu8Jw== X-Complaints-To: abuse@comcast.net X-DMCA-Complaints-To: dmca@comcast.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.1 Xref: archiver1.google.com comp.lang.ada:5547 Date: 2004-02-13T15:33:08-05:00 List-Id: Francesco Bochicchio wrote: > I thought of that: > > 1. It adds a function call overhead for each time one of the variables is > accessed ( and it happens a lot ) It does NOT add function call overhead, especially if you in-line the function. What it does do is insist that the names be re-evaluated when used. To the extent that this is what you wish, you get what you asked for. If you can use a grosser level of granularity, you can put some sections of code in a handler that just reinvokes the code, and have the code use local renames. > 2. It only solves variable reading. I don't see any equivalent way to > assign values to the variables. Huh? A function that returns an access type can appear as part of a name on the left hand side of an assignment statement. So if you have a function A that returns a pointer to an object with components C,D and E of type Integer, A.E := 3; works just fine. What you might have to do is a global replace on the code to change current instances of E to A.E assuming A and B are record containing the data that you want replicated. Notice that a renaming of A.E as E will "lock in" the current dereference. You can combine it with what I said above about granularity, and if the retries occur at a high enough level you won't have to change much. (All you have to do is put all renames inside the code that is retried after a failure.) There is no easy way to do the analysis needed to decide how far out you can move the retries in various areas of the code. But once you do that, renamings should work fine. -- Robert I. Eachus "The war on terror is a different kind of war, waged capture by capture, cell by cell, and victory by victory. Our security is assured by our perseverance and by our sure belief in the success of liberty." -- George W. Bush