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,FREEMAIL_FROM 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-10 12:56:23 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: 10 Oct 2003 12:56:23 -0700 Organization: http://groups.google.com Message-ID: <49cbf610.0310101156.2b7b8356@posting.google.com> References: <3F7316F7.219F@mail.ru> <17cd177c.0310010606.52da88f3@posting.google.com> <49cbf610.0310070205.2937e71a@posting.google.com> NNTP-Posting-Host: 213.248.15.42 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1065815783 2446 127.0.0.1 (10 Oct 2003 19:56:23 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 10 Oct 2003 19:56:23 +0000 (UTC) Xref: archiver1.google.com comp.lang.ada:646 Date: 2003-10-10T12:56:23-07:00 List-Id: aek@vib.usr.pu.ru (Alexander Kopilovitch) wrote in message news:... > Lutz Donnerhacke wrote: > > declare > > a : Typ renames X(b(i).all + 7); > > begin > > a := a + 2/a; > > end; > > > > is legal Ada and a common idiom. > > > > ... > > > > So I have to conlude, that the whole "idem" Idiom is useless at all. > > But "idem" require neither identifier nor declare-begin-end, and it is purely > local. Sometimes it is better to use renaming, but far from always - there are > enough cases where "idem" is better... and more natural. Use of renaming here > is just a middle of the spectre of solutions, where one edge is a function > returning access (which is generally more burdensome in Ada than in C) and > another edge is "idem". > > > > Alexander Kopilovitch aek@vib.usr.pu.ru > Saint-Petersburg > Russia i have a question about a : Typ renames X(b(i).all + 7); begin a := a + 2/a; end; it's possible to include it into code? begin ......something... ; a : Typ renames X(b(i).all + 7);--if possible, are this ; is a mistake or it's breaks all pascal "laws"? begin a := a + 2/a; end; .......something......... end; Yes,main problem with this that it's too long,more and more shugar are proposed. ... Ohh,why we don't have = with 3 lines in ASCII character set,just for nice smileys =_),for example, a=_ X(b(i).all + 7) in a := a + 2/a; looks better. (main problem that "in" is a relational operator,but still be understandable,and IMO better than all possible sorts of ..bad russian qword.. to make code more "readable") "=_" mean "= with 3 lines" Or maybe haskell-like a := a + 2/a where a=_ X(b(i).all + 7); (IMO not so good). Another question: why all these stu... still want +=, /= and \=,with nice >=,<=, juliafractal= and i-don-know-what-sort-of-idiotism with *= where a*b ?/= b*a ? (and ?/= is a pseudo-operator "unequal,maybe") Why beginner like me are interested in this subject: I don't want to spend my time learning language that will be c-like in near future,and then will die because c will always be more c-like than ada!. Heh, even beginner,coming from FreePascal,where "+=" are supported, don't want "+=" in Ada!!! Dmytry Lavrov, http://DmytryLavrov.narod.ru