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 Path: border1.nntp.ams3.giganews.com!border1.nntp.ams2.giganews.com!border3.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!gegeweb.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Is this expected behavior or not Date: Fri, 12 Apr 2013 10:00:48 +0200 Organization: cbb software GmbH Message-ID: <1k6lte6wjoer9.1kwm2g83k3gwy$.dlg@40tude.net> References: <1gnmajx2fdjju.1bo28xwmzt1nr.dlg@40tude.net> <3gv2jwc95otm.pl2aahsh9ox8.dlg@40tude.net> <1gkxiwepaxvtt$.u3ly33rbwthf.dlg@40tude.net> <1fmcdkj58brky.bjedt0pr39cd$.dlg@40tude.net> <1bj564vat3q1j$.1s4d00rlzx4ux$.dlg@40tude.net> <8bj2k30k7i19.w7ehsldwbf7x.dlg@40tude.net> <1o34nhpfuy6yl$.2orlukd1elr7.dlg@40tude.net> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: FbOMkhMtVLVmu7IwBnt1tw.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 X-Original-Bytes: 3043 Xref: number.nntp.dca.giganews.com comp.lang.ada:181028 Date: 2013-04-12T10:00:48+02:00 List-Id: On Fri, 12 Apr 2013 06:39:24 +0200, J-P. Rosen wrote: > Le 11/04/2013 17:07, Dmitry A. Kazakov a écrit : >>> The problem is not in the language. It is a wrong modelling, since a >>> > complex is not a specialisation of a real. >> Type extension is not specialization either. >> >> Specialization in Ada is more or less covered by subtypes. [Type extension >> is Cartesian product.] > Well, every proponent of OO will claim that inheritance is about > specialization. Specialization constraints the domain set and/or operations, which is not the case with type extensions. Extensions are popular because they don't touch the domain set. As a Cartesian product the derived type provides a mapping to the original domain, you just drop the second member of the pair: (parent_part, extension_part) -> parent_part. This allows to inherit many operations, but not factories. Anyway it is easy to see that specialization breaks some operations too. The text book case is the circle-ellipse controversy. When you specialize ellipses to circles you break operations like Resize. Now, how the compiler is supposed to inherit that? Ada 95 design was absolutely sound and correct in that respect. I am really amazed that you and Randy propose to change that to unsafe and semantically broken behaviour, in order to reduce amount of typing? Is it serious, or just to counter me? -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de