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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,66fae8c862b81b17 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.66.73.7 with SMTP id h7mr2242062pav.6.1352013911360; Sun, 04 Nov 2012 00:25:11 -0700 (PDT) Path: 6ni61154pbd.1!nntp.google.com!news.glorb.com!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Copy vector in Ada Date: Sun, 4 Nov 2012 08:25:10 +0100 Organization: cbb software GmbH Message-ID: <10y91ckm54l57$.8u8bbq342u1b.dlg@40tude.net> References: <1aWdnbcg_8-BzAzNnZ2dnUVZ_j6dnZ2d@giganews.com> <559eb706-9bb1-496d-9034-1984d693531a@googlegroups.com> <5460fdc7-5490-4889-b771-67cc281c10c5@googlegroups.com> <6260a796-83c4-4ce5-88cb-8249846bc035@googlegroups.com> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: pSb85Ij4EqcuHDcWtw64BQ.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Date: 2012-11-04T08:25:10+01:00 List-Id: On Sat, 3 Nov 2012 14:57:28 -0700 (PDT), Maciej Sobczak wrote: > No and I don't even intend to do it. Mixing assignment with polymorphism > is evil and cannot be implemented reasonably anyway. How so? Assignment is clearly a polymorphic operation. > Note that Ada does not provide any universal solution to this problem, Because it is a larger problem, which neither Ada nor C++ have a solution for, multiple dispatch. > either - assignment cannot be reasonably implemented apart from the case > of matching tags, You mean an implementation generated by the compiler? In such cases the programmer must be required to override. > Not much. In the case of derivation hierarchy, neither Ada nor C++ offer > anything usefu Yes >l (and that's OK as the concept is broken anyway). Concept of what? In C++ you can assign int to double. In Ada you can assign Positive to Integer. Is this broken? You do want to assign semantically same values of different types. That depends on the motivation why these types were designed different. It is not always so, that they were in order not to have assignments. > C++ does > provide a cleaner solution for the case of non-dispatching assignment. I would not call it cleaner, but usable at least. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de