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,1d321b3a6b8bcab2 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1995-01-26 10:51:21 PST Newsgroups: comp.lang.ada Path: nntp.gmd.de!newsserver.jvnc.net!howland.reston.ans.net!news.moneng.mei.com!uwm.edu!lll-winken.llnl.gov!enews.sgi.com!wdl1!wdl1!mab From: mab@wdl1.wdl.loral.com (Mark A Biggar) Subject: Re: "Subtract C, add Ada" Message-ID: <1995Jan26.185121.29955@wdl.loral.com> Sender: news@wdl.loral.com Organization: Loral Western Development Labs References: <3fode9$dap@soleil.uvsq.fr> <3g7ame$5d8@Starbase.NeoSoft.COM> Date: Thu, 26 Jan 1995 18:51:21 GMT Date: 1995-01-26T18:51:21+00:00 List-Id: In article <3g7ame$5d8@Starbase.NeoSoft.COM> smize@Starbase.NeoSoft.COM (Samuel Mize) writes: >It seems to me that something more general would be useful, >along the lines (NOT THIS SYNTAX, THIS IDEA): > > foo( bar( zot( element + 1))) := * ( + 3 ); That's what rename is for and it's more powerful to boot as you can choose exactly what parts of your expression get short names, For example: declare Left: Interger renames foo(bar(zot(element+1))); begin Left := Left * (Left + 3); end; but also: declare Index: Integer renames bar(zot(element+1)); begin foo(Index) := foo(Index) * ( foo(Index) + 3); end; You may well want to use the second case, if that documents your algorithm better. Note that a good compiler probably produces identical code for both examples assuming good common expression elimination. -- Mark Biggar mab@wdl.loral.com