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=-0.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, FREEMAIL_REPLY autolearn=no 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-19 10:33:54 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: 18k11tm001@sneakemail.com (Russ) Newsgroups: comp.lang.ada Subject: Re: Ideas for Ada 200X Date: 19 Jun 2003 10:33:53 -0700 Organization: http://groups.google.com/ Message-ID: References: <5e9b8c34.0306181050.3c4cc664@posting.google.com> NNTP-Posting-Host: 128.102.146.44 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1056044034 31465 127.0.0.1 (19 Jun 2003 17:33:54 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 19 Jun 2003 17:33:54 GMT Xref: archiver1.google.com comp.lang.ada:39454 Date: 2003-06-19T17:33:54+00:00 List-Id: "Dmitry A. Kazakov" wrote in message news:... > Russ wrote: > > > Brian.Gaffney@myrealbox.com (Brian Gaffney) wrote in message > > news:<5e9b8c34.0306181050.3c4cc664@posting.google.com>... > >> 18k11tm001@sneakemail.com (Russ) wrote in message > >> news:... > >> > Preben Randhol wrote in message > >> > news:... > >> > > Russ wrote: > >> > > > If you really insist that "+=" looks too much like ":=", then I > >> > > > think ":+=" or some such kludge is the next best thing, but darnit > >> > > > that's ugly. > >> > > > >> > > Yes it is ugly the way you wrote it, but +:= isn't. Remember that > >> > > assignment in Ada is := so one shouldn't seperate these two signs. > >> > > > >> > > > I'm trying, but I'm still having trouble seeing "+=" being confused > >> > > > with ":=". > >> > > > >> > > What about /= ? The problem is that += doesn't make sense in Ada as = > >> > > is not the assignment syntax := is. > >> > > >> > An interesting idea just popped into my head. We've considered "+=" > >> > and "+:=", but what about ":+"? Check it out: > >> > > >> > count :+ 1 > >> > A :+ B > >> > var :/ 2.0 > >> > > >> > Simple, clear, only two characters, and no conflict with "/=". What do > >> > you think? > >> > >> Let me start by saying that I can't believe I'm adding to this thread. > >> I really don't see that any of this would be an improvement. > >> > >> Having said that, let me make my proposal on how to fix this 'problem' > >> without creating new keywords or operators: Create procedures such as > >> the following for the various operators and various types, along with > >> the existing functions. > >> > >> procedure "+" (Left : in out Integer; Right : in Integer); > >> > >> That way we could have: > >> > >> begin > >> I := I + 1; > >> I + 1; --equivalent > >> end; > >> > >> {BTW, would that lead to this: > >> procedure "+" (Right : in out Integer); --the same as i++ > >> ?} > >> > >> Again, let me emphasize that I'm not suggesting this should become > >> part of Ada! > >> > >> --Brian > > > > "+" is a function that returns the sum of its two arguments without > > modifying either of those arguments. > > "+" is a sequence of characters. Period. > > > How could it also be a procedure > > that modifies one of its arguments? > > That thing is called overloading. BTW, see my example below for a procedure, > which does *not* modify any of its arguments. If i := i + 1 is equivalent to i + 1, then what does i = i + j + 1 mean? Does j get incremented by 1? Either way, I'd say readability went out the window.