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,54889de51045a215 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-10-15 11:53:46 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!news-out.visi.com!petbe.visi.com!ash.uu.net!spool.news.uu.net!not-for-mail Date: Wed, 15 Oct 2003 14:53:36 -0400 From: Hyman Rosen User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5b) Gecko/20030901 Thunderbird/0.2 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: += in ada References: <49cbf610.0310101231.2358762a@posting.google.com> <1066224357.499523@master.nyc.kbcfp.com> <1066231159.711433@master.nyc.kbcfp.com> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Organization: KBC Financial Products Message-ID: <1066244017.39486@master.nyc.kbcfp.com> Cache-Post-Path: master.nyc.kbcfp.com!unknown@nightcrawler.nyc.kbcfp.com X-Cache: nntpcache 3.0.1 (see http://www.nntpcache.org/) NNTP-Posting-Host: 204.253.250.10 X-Trace: 1066244017 3385 204.253.250.10 Xref: archiver1.google.com comp.lang.ada:914 Date: 2003-10-15T14:53:36-04:00 List-Id: Vinzent 'Gadget' Hoefler wrote: > You heard about "abstraction"? Ada is a high level *language*, not a > high level assembler. But the concept of "add this to that" *is* an abstraction. > And BTW, it's a funny thing that the compiler might compile > |a += 2; > to > | movl a,%eax > | addl $2,%eax > | movl %eax,a > instead of > | addl $2,a See? It's an abstraction, not an attempt to duplicate assembler! > The idea was to let the programmer say what it wants and let the > compiler figure out how to map that onto the target hardware Exactly. And what the programmer wants is to add a value to a variable. If I'm keeping a running total, I want to say "add this item to the total" not "compute the sum of the current total and this item, and replace the current total with the new total". That's why COBOL had "ADD A TO B."