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,73cb216d191f0fef X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,BIG5 X-Received: by 10.180.86.38 with SMTP id m6mr1251239wiz.0.1364344441348; Tue, 26 Mar 2013 17:34:01 -0700 (PDT) Path: ex12ni5417wid.1!nntp.google.com!feeder1.cambriumusenet.nl!feed.tweaknews.nl!85.12.40.138.MISMATCH!xlned.com!feeder5.xlned.com!npeer.de.kpn-eurorings.net!npeer-ng0.de.kpn-eurorings.net!border2.nntp.ams2.giganews.com!border4.nntp.ams.giganews.com!border2.nntp.ams.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newsgate.cuhk.edu.hk!goblin1!goblin2!goblin.stu.neva.ru!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Is this expected behavior or not Date: Thu, 21 Mar 2013 10:08:06 +0100 Organization: cbb software GmbH Message-ID: References: <18r2kop6fyozu.tctrjnghfxqs.dlg@40tude.net> <1wv3p3nrtejfk$.bwebhg9agt0l.dlg@40tude.net> <514874d3$0$6628$9b4e6d93@newsspool2.arcor-online.net> <1o60gooo8xvba$.1ei9cebb07zek$.dlg@40tude.net> <514897bd$0$6641$9b4e6d93@newsspool2.arcor-online.net> <1oqwvcemo8dha$.hevuedtz8eze.dlg@40tude.net> <14aijp8ckzahf$.1ilfm1nw6qgyt$.dlg@40tude.net> <1xg9wka6slgit.1q0leacagdeuv.dlg@40tude.net> 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 Content-Type: text/plain; charset="big5" Content-Transfer-Encoding: 8bit Date: 2013-03-21T10:08:06+01:00 List-Id: On Wed, 20 Mar 2013 18:31:29 -0500, Randy Brukardt wrote: > "Dmitry A. Kazakov" wrote in message > news:1xg9wka6slgit.1q0leacagdeuv.dlg@40tude.net... >> On Wed, 20 Mar 2013 12:01:25 +0100, J-P. Rosen wrote: >> >>> Le 20/03/2013 11:04, Dmitry A. Kazakov a ��it : >>>>> It is different in that a subtype does NOT inherit operations, it has >>>>> the SAME operations as its type. >>>> >>>> How do you know that they are same? In what sense are they same? >>>> >>>> But they are evidently not same: >>>> >>>> procedure Foo (X : out Integer) is >>>> begin >>>> X := -1; >>>> end Foo; >>>> >>>> when inherited by Positive changes its behavior. >> >>> They are not inherited! You can call the above Foo with a variable of >>> type Positive; Constraint_Error is raised after the call when converting >>> back. But once again, it is the same operation that is called by Integer >>> and Positive. >> >> See, same operation applied to same value of same type gives different >> result. >> >> This is called UNTYPED. > > Sounds right to me; by the rules of your useless definitions, you can > clearly prove that Ada is untyped. Nope. A language is untyped only if no typed interpretation of its semantics exists. J-P gave an untyped interpretation of Ada's Positive. I proposed a typed one. Thus, Ada is typed. [...] > To me, this just demostrates the worthlessness of your definitions when > applied to Ada. Apparently others feel the same way. Sorry, that is not mine definitions, it is *your* worthy definition according to which *same* operation on *same* value of *same* type yields *different* results. >> Inheritance as-is composed with a conversion is relatively harmless when >> the constraint is a range. But when the constraint is arbitrary it would >> break almost everything and it does. This is a hard mathematical fact, no >> LRM or ISO has any authority here. > > The whole idea of "inheritance" has almost no value in any context. It's > definitely not worth the energy that people (including) have put into it. A > model where every type started with a clean slate other than predefined > operations works just as well. Once you create an Ada subtype you inherit operations of the base. If you don't like it, you should be the first for allowing at least overriding inherited operations, when they become junk as in the case of Prime'Succ. You should also be in favor for means to specify what should be inherited. The only mechanism for this I know is explicit interfaces. >> The definition is independent on any language. I don't redefine the meaning >> of Ada-subtype. I translate Ada's definition into the terms of ADT. In >> these terms Ada-subtype is a proper type. > > I disagree that Integer is an "ADT" in the first place. There is nothing > "abstract" about Integer or any numeric type (even using the English meaning > of "abstract") -- all of the values and operations are known and defined by > the type declaration. Calling it an "ADT" seems brain-damaged to me; an ADT > in Ada is a private type or an interface or an abstract type -- there has to > be something hidden. Abstract in ADT means that the specification is abstracted from the implementation. Anyway, is it only abstractness you are against? From your posts I have an impression that Integer is not only non-"abstract," but also not a "type," and possibly not even "data." -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de