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,54889de51045a215 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-10-04 13:17:11 PST Path: archiver1.google.com!news2.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!pd2nf1so.cg.shawcable.net!residential.shaw.ca!sjc70.webusenet.com!news.webusenet.com!elnk-nf2-pas!elnk-pas-nf1!newsfeed.earthlink.net!newsfeed2.easynews.com!newsfeed1.easynews.com!easynews.com!easynews!border3.nntp.aus1.giganews.com!intern1.nntp.aus1.giganews.com!nntp.giganews.com!nntp.clear.net.nz!news.clear.net.nz.POSTED!not-for-mail NNTP-Posting-Date: Sat, 04 Oct 2003 15:17:09 -0500 From: Craig Carey Newsgroups: comp.lang.ada Subject: Re: += in ada Date: Sun, 05 Oct 2003 09:17:08 +1300 Message-ID: References: <3F7316F7.219F@mail.ru> X-Newsreader: Forte Agent 1.92/32.572 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Organization: Customer of Mercury Telecommunications Ltd Cache-Post-Path: drone5.qsi.net.nz!unknown@tnt1-13.quicksilver.net.nz X-Cache: nntpcache 2.4.0b5 (see http://www.nntpcache.org/) X-Original-NNTP-Posting-Host: drone5-svc-skyt.qsi.net.nz X-Original-Trace: 5 Oct 2003 09:17:10 +1300, drone5-svc-skyt.qsi.net.nz NNTP-Posting-Host: 203.97.37.6 X-Trace: sv3-fCvbRHVKn+Y6tOLAOXqeuiFPLsvph4HD8zVFFYgfp/U7VGGN49k0TPtNvdeW8bsXlCyc/zjhkKy84SE!VPCX+748VFywKVKLCJy0N+X+4chlKQLh64vFb7lQhPqzTRvpp3HEhHJNA9hZGi+3XLtgdkbzpNuy!a3icf+k= X-Complaints-To: Complaints to abuse@clear.net.nz X-DMCA-Complaints-To: Complaints to abuse@clear.net.nz 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:231 Date: 2003-10-05T09:17:08+13:00 List-Id: On Wed, 01 Oct 2003 09:35:59 +0100, Peter Amey wrote to comp.lang.ada: >Subject: Re: += in ada" >>> >>> count = count + 1[;] >>> >>>The latter grates on my minimalist sensibilities like fingernails on a >>>chalkboard The arguments in favour of += that come from C programmers seem to be arriving at comp.lang.ada. They should be unpersuasive since ignoring the "renames" replacement for the possible but missing "+=" operator. Suppose this Ada code in the proposed C style, and += and -= are used: 01 A.Bcd += 1; 02 A := Z; 03 A.Bcd -= 1; Now let A be pointer to a record containing a field named 'Bcd'. This is the same code in Ada 95. Unlike real declarations, the renames statement can associate a single variable name with any element of a shiftinglist of possible memory locations. Ada has the much needed goto which allows a solution that seems to be overly verbose: 01 No_Redo_Renaming : Boolean; ... 02 No_Redo_Renaming := False 03 <> 04 declare 05 R : Integer renames A.all.Bcd; 06 begin 07 if No_Redo_Renaming then 08 R := R + 1; 09 A := Z; 10 No_Redo_Renaming := False; 11 goto REDO_RENAMING; 12 else 13 R := R - 1; 14 end if; 15 end; If R is intended to denote all the different R's then the code need can be briefer. Arguments for new features that are inconsiderate could fail make it all the way out to the end. Advocacy of += has so far failed to say what is wrong with this syntax: 01 declare R : Integer renames A.all.Bcd; end; 02 R := R + 1; 03 A := Z; 04 declare R : Integer renames A.all.Bcd; end; 05 R := R - 1; Variations on that could include: * "end" is replaced with "end declare;" * "declare is replaced with "begin declare". What C++ programmers might now want, is to give up on saying that Ada needs a += operator, since it seems to be a hopeless cause. ----- This topic is also in the large thread that now has over 437 messages. A message there that allocates failure to the "+=" proposal is this: At 27 Sep 2003 17:43:42 -0500, "Randy Brukardt" wrote to comp.lang.ada: >Subject: Re: Is the Writing on the Wall for Ada? [although this thread > changed to something else a long time ago] ... >In any case, I'm sympathic to the issue, but (a) I don't like this syntax, >and there are other solutions, and (b) there are a hundred issues more >important. I note that you didn't answer my note asking what you'd give up >for this rather substantial change. > >>I've seen some weak arguments here, and this one is typical. What is >>increasingly apparent to me is that Ada veterans are set in their >>ways, and no amount of reason will budge them on the basic syntax of >>Ada, even when if is deficient compared to the existing languages that >>98% of programmers use. ... It could be a joke: the set of unreasonable veterans is empty but the description description parallels what suggesting big changes to C++ projects. Mr Dewar here states that there is a need for some to get a "$" operator: ---------------------------- At 2002-11-09 22:10 -0500 Saturday, Robert Dewar wrote to ada-comment@ada-auth.org: ... >Note incidentally that the grade school idea does not work for >division, since the / operator has nothing to do with mathematics, >where the horizontal line used for division uses a graphical technique >to indicate precedence. In SNOBOL4 Griswold changed / to have lower >precedence than multiplication > >so a*b / c*d means what it looks like, but this sure confused the >Fortran folk. > ><topic at hand. >>> > >I am not sure that is the case. After all the actual topic at hand is >useful additions to the language. Maybe allowing $ to be defined as an >operator is just as interesting as bit string set packages :-) > ---------------------------- Using my syntax begin declare function "$" (L : lhs T; R : constant T) return T renames "~#="; end; It might be nice to have constant to be like the "in" mode, except that that objects underneath pointers are also constant, which better hide when the objects are pointers or records. >Ada has real technical issues that need fixing, Some is online here: http://www.ada-auth.org/ai-files/REST_AIS.ZIP ----- On 24 Sep 2003 17:42:06 -0700, 18k11tm001-@-sneakemail.com (Russ) wrote to comp.lang.ada: ... which of the following is more readable [?]: > >lwienfowowoenfnowoqndfoowopqihjefhnowqoowldvno := > lwienfowowoenfnowoqndfoowopqihjefhmowqoowldvno + 1 > >or > >lwienfowowoenfnowoqndfoowopqihjefhnowqoowldvno += 1 Swapped an "n" with an "m". Craig Carey