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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC 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 00:39:46 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!newsfeed.freenet.de!fu-berlin.de!uni-berlin.de!dialin-145-254-041-173.arcor-ip.NET!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Ideas for Ada 200X Date: Thu, 19 Jun 2003 09:42:31 +0200 Organization: At home Message-ID: References: <3EECA772.4B662024@adaworks.com> <5e9b8c34.0306181050.3c4cc664@posting.google.com> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: dialin-145-254-041-173.arcor-ip.net (145.254.41.173) Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Trace: fu-berlin.de 1056008386 23658511 145.254.41.173 (16 [77047]) User-Agent: KNode/0.7.1 Xref: archiver1.google.com comp.lang.ada:39432 Date: 2003-06-19T09:42:31+02:00 List-Id: 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. > You think the same symbol taking > the same argument types can be used for both a procedure and a > function? You forgot the result type, which makes the parameter profiles different. --- I also made this proposal before, so let me now critisize it a bit. What about A + B + C; where: type C_Type is ...; type A_Type is access all C_Type; type B_Type is new Integer; ... function "+" (Addr : A_Type; Offs : B_Type) return A_Type; procedure "+" (Addr : A_Type; Value : C_Type); So the above means would mean: add C at A plus offset B. That damned C again! (:-)) Or: procedure "=" (L : in out Integer; R : Integer); ... X = 1; This would make people really happy! (:-)) -- Regards, Dmitry A. Kazakov www.dmitry-kazakov.de