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: a07f3367d7,66fae8c862b81b17 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Received: by 10.66.80.98 with SMTP id q2mr2726078pax.33.1352353208429; Wed, 07 Nov 2012 21:40:08 -0800 (PST) From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Copy vector in Ada Date: Mon, 5 Nov 2012 10:20:44 +0100 Organization: cbb software GmbH Message-ID: <1r3lpzblxy43h$.zytp8ur1bg27$.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> <10y91ckm54l57$.8u8bbq342u1b.dlg@40tude.net> <2164bc1a-a841-46ed-bfef-4ddcae4d64f7@googlegroups.com> <1ccf2169-418c-44b7-9d5a-b684a017fbe7@googlegroups.com> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: FbOMkhMtVLVmu7IwBnt1tw.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 Path: 6ni68208pbd.1!nntp.google.com!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!news.mccarragher.com!news.grnet.gr!newsfeed.CARNet.hr!aioe.org!.POSTED!not-for-mail X-Received-Bytes: 3994 Content-Type: text/plain; charset="iso-8859-2" Content-Transfer-Encoding: 8bit Date: 2012-11-05T10:20:44+01:00 List-Id: On Mon, 5 Nov 2012 00:50:25 -0800 (PST), Maciej Sobczak wrote: > W dniu poniedzia�ek, 5 listopada 2012 09:31:13 UTC+1 u�ytkownik Dmitry A. Kazakov napisa�: > >>> It is not "clearly" to me. Assigning Rectangles to Triangles does not make any sense. >> >> Does the example presume that both are in the same hierarchy of types, e.g. >> "shape"? Whether assignment makes sense depends on that. > > You can always imagine arbitrary meanings of "assignment" and implement it, like: > > D : Date; > > D := "tomorrow"; > > But we are diverting from the subject of whether limitedness and > assignment are supported consistently and orthogonally to other language > features. Then it was you who tried. My point was that assignment, or better to say, copy constructor (from which assignment is deduced), is a doubly-dispatching "operation." It is not orthogonal and cannot be. There are lots of further questions about special treatment of copy constructors, like whether one could introduce them later, e,g, promoting limited types to non-limited and demoting back. These should be considered in the larger context of disallowing operations, subtracting interfaces etc. But the starting position is independent on that. >>> I also mean what the programmer might possibly provide - Rectanges vs. Triangles and so on. >> >> He will replace a triangular shape with a rectangular one. > > Wrong. The existing alias of Trangle'Class will break. What is alias? As for "breaking" anything, that is technically speaking substitutability. Substitutability is an issue if and only if, you inherit. Once the programmer overrides or is forced to override there is no issue of substitutability and there is no breaking. If you say that the programmer could not implement the overridden operation without violation of some semantic constraints that is another issue, not a language business, except for checking static contracts. The programmer must then choose another type hierarchy design, but that is outside the language scope. >> You make some assumptions about the semantics of >> assignment, which may or may not hold. Again, it is not the language >> business. > > Yes. Let's agree that the language should allow this possibility. > We are still diverting from the subject of whether the existing solution > is elegant and orthogonal with respect to other language features. Neither elegant, nor orthogonal. Both languages did it wrong. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de