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,54889de51045a215 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-10-07 03:05:10 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: dmytrylavrov@fsmail.net (Dmytry Lavrov) Newsgroups: comp.lang.ada Subject: Re: += in ada Date: 7 Oct 2003 03:05:10 -0700 Organization: http://groups.google.com Message-ID: <49cbf610.0310070205.2937e71a@posting.google.com> References: <3F7316F7.219F@mail.ru> <17cd177c.0310010606.52da88f3@posting.google.com> NNTP-Posting-Host: 213.248.15.31 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1065521110 32660 127.0.0.1 (7 Oct 2003 10:05:10 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 7 Oct 2003 10:05:10 +0000 (UTC) Xref: archiver1.google.com comp.lang.ada:367 Date: 2003-10-07T03:05:10-07:00 List-Id: 18k11tm001@sneakemail.com (Russ) wrote in message news:... > Keith Thompson wrote in message news:... > > Lutz Donnerhacke writes: > > > * Preben Randhol wrote: > > > > On 2003-10-02, Lutz Donnerhacke wrote: > > > >> The "idem"-Idiom would be much better. > > > >> X(b(i).all+7) := idem + 2/idem; > > > > > > > > The problem I have with idem is that it looks like just another > > > > variable. > > > > > > I insist on the semantical meaning, but not on the syntactical term. > > > > Didn't somebody once suggest "@" for this? > > > > X(b(i).all+7) := @ + 2/@; > > Yes, I did. I think "@" is appropriate because it represents what is > "at" the location that is about to be overwritten. But I don't think > this notation is as good as ":+", etc. Yes, it *is* more general, but > that generality is rarely needed. :+ ??? what with := and boolean operators? about "@" it's look like attempt to make things more readable by replacing firse operand in expression by @ (@1),second by @2,third by @3.... c:=(a+b)*@2*@4+@1 ; ;-) where @1=c; @2=a; @3=b; @4=(a+b); @5=@2; @6=@4; @7=(a+b)*@2*@4; Maybe for first it's good,but... i think it's better to use something like begin @ is X(b(i).all+7);@:=@+2/@; end; or,more generally,to use something like begin declare_new_name a _for_ X(b(i).all+7); -- for example, "a is X(b(i).all+7)" a:=a+2/a; end; (and something like that already are in ada,but while i'm beginner in ada,i can't remember) "+=" is a idea about in-place operations,and @ is about readability. IMO,in place operations should be used as normal procedures like inc(a,b) or juliafractalstep(z,c);, not like "+=","-=","*=",and "/=", "a\=b" for a:=b/a;, and i don't know what for matrixes a:=b*a;,maybe "\*=" or simply "\*" even with ":=","=:",or ":" instead of "=",or with any char,it's still be bad. Dmytry Lavrov, http://dmytrylavrov.narod.ru