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,38fc011071df5a27 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-06-16 09:19:25 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!news.tele.dk!news.tele.dk!small.news.tele.dk!news-fra1.dfn.de!news-koe1.dfn.de!RRZ.Uni-Koeln.DE!uni-duisburg.de!not-for-mail From: Georg Bauhaus Newsgroups: comp.lang.ada Subject: Re: Ideas for Ada 200X Date: Mon, 16 Jun 2003 16:19:24 +0000 (UTC) Organization: GMUGHDU Message-ID: References: <3EE7CC70.E1FD3A67@adaworks.com> <3EECA772.4B662024@adaworks.com> NNTP-Posting-Host: d2-hrz.uni-duisburg.de X-Trace: a1-hrz.uni-duisburg.de 1055780364 25078 134.91.1.15 (16 Jun 2003 16:19:24 GMT) X-Complaints-To: usenet@news.uni-duisburg.de NNTP-Posting-Date: Mon, 16 Jun 2003 16:19:24 +0000 (UTC) User-Agent: tin/1.5.8-20010221 ("Blue Water") (UNIX) (HP-UX/B.11.00 (9000/831)) Xref: archiver1.google.com comp.lang.ada:39255 Date: 2003-06-16T16:19:24+00:00 List-Id: Bill Findlay wrote: : : shiftTally(shift)(dayOfWeek(month).tallyIndex).sortTally(s).nbRejects := : idem + 1; Hm. How about renaming and access values? The following two examples of ad hoc code have given me the effect of idem. procedure waiter is b: Bill; begin add(b, Soup); add(b, Chicken); declare use type Prices.Amount; p: constant Bill_item := item_at(sort(b), 2); -- this would be your long LHS. begin p.all := p.all + 1.20; -- only one call on item_at here end; add(b, Rice); end waiter; There is only one call on sort before the left hand side gets its new value. call bills__add movl %eax,%ebx pushl $2 pushl %ebx call bills__sort addl $4,%esp pushl %eax call bills__item_at addw $153,(%eax) pushl $4 pushl %ebx call bills__add Similarly, given a complex data structure, and some functions for indexing the data structures, type Arrow is access all Point; type Point_list is array(List_index) of Arrow; function make_one return Point_list; function rand return List_index; then from begin with_renaming: declare p: Arrow renames make_one(rand); begin p.x := p.x + 333; end with_renaming; without_renaming: begin make_one(rand).x := make_one(rand).x + 555; end without_renaming; end big; I get a total of 3 calls to make_one and rand, one of each in the with_renaming block, two of each in the other block, without renaming. -- Georg