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,60e2922351e0e780 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-11-07 15:00:03 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.stueberl.de!newsr1.ipcore.viaginterkom.de!btnet-peer1!btnet-peer0!btnet-feed5!btnet!news.btopenworld.com!not-for-mail From: "Martin Dowie" Newsgroups: comp.lang.ada Subject: Re: Clause "with and use" Date: Fri, 7 Nov 2003 22:59:14 +0000 (UTC) Organization: BT Openworld Message-ID: References: <3FA50083.10709@noplace.com> <3FA777E9.4030605@noplace.com> NNTP-Posting-Host: host81-129-48-51.in-addr.btopenworld.com X-Trace: hercules.btinternet.com 1068245954 17695 81.129.48.51 (7 Nov 2003 22:59:14 GMT) X-Complaints-To: news-complaints@lists.btinternet.com NNTP-Posting-Date: Fri, 7 Nov 2003 22:59:14 +0000 (UTC) X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MSMail-Priority: Normal X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Xref: archiver1.google.com comp.lang.ada:2242 Date: 2003-11-07T22:59:14+00:00 List-Id: "Russ" <18k11tm001@sneakemail.com> wrote in message news:bebbba07.0311071231.239981ea@posting.google.com... > "Martin Dowie" wrote in message news:... [snip] > > So why don't they use it? I don't no for sure but one of the explicit > > aims of Python was to promote readability. > > I will reply a second time to this post so that I may clarify a couple > of points. > > As I wrote the first time, "+=" was introduced in Python only > relatively recently, which explains why it does not appear much in the > libraries. Well, it's been >2 years... and so far I've seen little use of it yet - but I stand to be corrected... [snip] > > Perhaps, Russ, you could instil a vigorous debate over at c.l.p. > > and ask them why they are being so 'idiotic'? ;-) > > Well, I see your little ";-)", so I realize that you are not > exhibiting overt hostility. Nevertheless, it is clear to me that you > and others have misconstrued what I wrote about idiots and idiocy. Sorry - just yanking your chain! :-) [snip] > > So, Russ, have read AI-318? Do you still think that "+=",etc is > > still necessary, now there is a mechanism to avoid that extra deep > > copy for things like matrices/vectors? > > I started to read it, but it's a bit too technical for me. Too many of > those wierd vowels. 8^) I don't know if it solves the problem of > efficient vector/matrix operations, but it if does, it sure looks a > lot more complicated to me than "+=" (or ":+"). If you have time, I > would appreciate an example of how it would be used for matrix > addition, for example. Just the calling statement using an overloaded > "+" will be sufficient. That's exactly what it's getting at (provided the "+" operator is defined correctly :-) A := B * C; -- would not require an extra copy where "*" is still defined as per any other function: function "*" (Left, Right : Real_Matrix) return Real_Matrix; the difference would be in the body (as currently spec-ed): function "*" (Left, Right : Real_Matrix) return Real_Matrix is begin -- Do some checks on 'Left' and 'Right', raise Constraint_Error -- if erroneous declare Result : out Real_Matrix (..., ...); -- Ranges based on Left and Right begin return Result; -- Actually returns a value 'in-situ' end; end "*"; BUT as per my other chat with RIE: A := A * C; -- might very well require an 'extra' copy but that extra copy may be necessary to do it 'right' - as in Python. -- Martin