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,d2f0af5e440b367f X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-06-27 01:15:09 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!headwall.stanford.edu!fu-berlin.de!uni-berlin.de!tar-alcarin.cbb-automation.DE!not-for-mail From: Dmitry A. Kazakov Newsgroups: comp.lang.ada Subject: Re: proposal for new assignment operators Date: Fri, 27 Jun 2003 10:15:03 +0200 Message-ID: References: NNTP-Posting-Host: tar-alcarin.cbb-automation.de (212.79.194.111) Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: fu-berlin.de 1056701705 29930855 212.79.194.111 (16 [77047]) X-Newsreader: Forte Agent 1.8/32.548 Xref: archiver1.google.com comp.lang.ada:39801 Date: 2003-06-27T10:15:03+02:00 List-Id: On Thu, 26 Jun 2003 10:37:57 +0000 (UTC), Lutz Donnerhacke wrote: >* Dmitry A. Kazakov wrote: >> Lutz Donnerhacke wrote: >>> * Dmitry A. Kazakov wrote: >>>> Provided 1.& 2. one could just enlarge the set of lexical elements and >>>> let the programmer to choose what he/she wants. I would like to see >>>> "<+>", "[+]", "(+)", "+:=", "<+>:=" etc added, but is that worth the >>>> efforts? >>> >>> No. The "idem" proposal is worth the efforts. >> >> Probably yes, but "idem" is rather an independent thing. It does not solve >> neither a problem of in-place operations (including constructors), nor a >> problem user-defined assignment(s) [for all types.] > >If so, then "procedure Add_Inplace(to : in out Matrix, a : in out Matrix);" >exists and has to be provided anyway. >From this point of view there is also no need to have any assignment statement. Why do you need ":=" if procedure Set (To : in out Matrix; From : Matrix); can be defined? As I said the problem is not lexical. One can live with Set instead of ":=" or Add_Inplace instead of "". The problem is in semantics. What happens [with assignments] if you derive from Matrix? What happens if you aggregate Matrix in some other type? C++ says: "it is all your business, dear." Ada tries to protect you as much as possible. That's far not easy. And note that when you say that Add_Inplace is enough, you, in effect, follow C++'s, not Ada's way. --- Regards, Dmitry Kazakov www.dmitry-kazakov.de