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,f51e93dacd9c7fca X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-06-24 18:28:12 PST From: Dale Stanbrough Newsgroups: comp.lang.ada Subject: Yet another assignment variation (was Re: status of Ada STL?) Organization: RMIT References: User-Agent: MT-NewsWatcher/3.2 (PPC Mac OS X) Date: Tue, 25 Jun 2002 11:24:45 +1000 Message-ID: NNTP-Posting-Host: dale2.cs.rmit.edu.au X-Trace: itsawnews.its.rmit.edu.au 1024968430 dale2.cs.rmit.edu.au (25 Jun 2002 11:27:10 +1000) Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!news1.optus.net.au!optus!newshub1.rdc1.nsw.optushome.com.au!harbinger.cc.monash.edu.au!vrn.edu.au!131.170.8.40.MISMATCH!itsawnews.its.rmit.edu.au!dale Xref: archiver1.google.com comp.lang.ada:26679 Date: 2002-06-25T11:24:45+10:00 List-Id: Steven Deller wrote: > One more voice for some notation that shows the result of an assignment > is the same as the first item in the expression. This is NOT a "do it > like C" or "do it like Icon" vote, but an "express what I mean in a > readable fashion" vote. > > +:= -:= *:= /:= > would be fine > > Since we have the ":" to work with, we could also put the operation on > the proper side of the start of the assignment. How about > :+ :- :* :/ > > That keeps the syntactical look-ahead to two symbols and also, once you > get used to it, seems (to me) to be more readable than either the C or > Icon notation, where the operator seems to be misplaced. > > x :+ 1 ; -- x is x with one added > y :- 1 ; -- y is y with one subtracted > z :/ 2 ; -- z is z divided by 2 > a :* (z+2)/3 ; -- y is y multiplied by (z+2)/3 How well would this apply to multi character operators? a :** y; X : Boolean; X :/= Y; X :or z; x :rem z; Sounds tricky to me (and i'm not sure it looks readable - maybe it would require getting used to). Perhaps instead we could come up with smiley assignments... x :-) y; -- happily overwrite x x :-/ y; -- unsure assignment... -- good for 1st year students Dale