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=unavailable autolearn_force=no version=3.4.4 X-Received: by 2002:a6b:bec1:: with SMTP id o184-v6mr3767758iof.8.1527792815807; Thu, 31 May 2018 11:53:35 -0700 (PDT) X-Received: by 2002:a9d:4501:: with SMTP id w1-v6mr129500ote.8.1527792815646; Thu, 31 May 2018 11:53:35 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!news.gegeweb.eu!gegeweb.org!news.redatomik.org!newsfeed.xs4all.nl!newsfeed8.news.xs4all.nl!85.12.16.69.MISMATCH!peer02.ams1!peer.ams1.xlned.com!news.xlned.com!peer02.am4!peer.am4.highwinds-media.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!v8-v6no1134985itc.0!news-out.google.com!b185-v6ni1231itb.0!nntp.google.com!v8-v6no1134979itc.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Thu, 31 May 2018 11:53:35 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=47.185.233.194; posting-account=zwxLlwoAAAChLBU7oraRzNDnqQYkYbpo NNTP-Posting-Host: 47.185.233.194 References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <534965d3-e494-476b-8a91-6cf9f376c020@googlegroups.com> Subject: Re: about inheritance of subtypes and entities (such as constants) related to a type in the same package From: "Dan'l Miller" Injection-Date: Thu, 31 May 2018 18:53:35 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Received-Bytes: 5851 X-Received-Body-CRC: 4007064726 Xref: reader02.eternal-september.org comp.lang.ada:52814 Date: 2018-05-31T11:53:35-07:00 List-Id: On Thursday, May 31, 2018 at 12:37:07 PM UTC-5, Dmitry A. Kazakov wrote: > On 2018-05-31 04:29 PM, Dan'l Miller wrote: > > Conversely, subtyping in Ada does none of that type-extension stuff: n= o > >=C2=A0additional data/cardinality-of-the-members-of-the-set, no addition= al >=C2=A0>=C2=A0routines/behavior, no arbitrary refinement of behavior of ove= rridden/copied > >=C2=A0routines/operations. Instead, subtyping in Ada is strictly subjec= ting the > >=C2=A0parent type to an additional membership-narrowing predicate, such = as subset >=C2=A0>=C2=A0in set theory. Randy likewise spoke of membership on other b= ranches of this >=C2=A0>=C2=A0thread. >=20 > Untrue. Ada 83 subtyping extends the supertype (base type), because it=20 > exports operations defined on the subtype to the base type. Ada 83=20 > subtyping introduces an equivalent type, which is both sub- and=20 > supertype of the base. If Ada83 untagged subtyping is type extension, please provide even a single= characteristic that was extended/added/supplemented instead of contracted/= subtracted/elided by the predicate. It seems that the only thing actually = extended/added/supplemented in a subtype is logical conjunction (i.e., and)= of another predicate. Copied (as from an exemplar) is a better term than = inherited. Indeed, in Ada, the parent untagged type and untagged subtype need not shar= e the same representation. Not even representation is necessarily inherite= d by the subtype from the parent type. And if representation of the subtyp= e can differ, then this so-called inheritance of subtypes from parent types= really does look more like things that do versus don't get copied from a p= rior exemplar via rules governing that copying-from-exemplar. Clearly, mechanical copying-from-exemplar some things but not others is not= type extension. (Only type extension is inheritance.) Type extension is = taking the whole parent type without all this piecemeal elision-surgery (as= a whole enchilada) and actually =E2=80=A2adding=E2=80=A2 something more su= bstantial than a predicate to it (so that now the whole enchilada now has s= ome sauce or a side of rice and beans added to it). Btw, I realize that Ada's _LRM_ utilizes 1,000 times the term "inherit" col= loquially in the sense of OP's and Dmitry's usage. Based on my exploration= of the _LRM_, it never normatively states a definition for what inheritanc= e is versus is not with respect to untagged types. The _LRM_ just uses the= term inherit colloquially with respect to untagged types. In all the plac= es where the _LRM_=C2=A0colloquially uses "inherit", it could have utilized= "receive" instead to emphasize the copy-from-prior-exemplar truly-intended= meaning. The OP's gotcha point is deftly dismantled by changing the collo= quialism from inherit to receive. Upon realization that "inherit" is a mer= e colloquialism used for convenience in the _LRM_ regarding untagged types,= suddenly Ada83's receiving-from-prior-exemplar semantics regarding untagge= d types versus Ada95-onward's inheriting semantics regarding tagged types 1) no longer looks botched as some sort of philosophical mismatch, 2)=C2=A0no longer looks like a Ichbiah-versus-Taft conceptual tug of war fo= r control of the steering wheel of the rudder of Ship Ada, and 3) no longer has the (OP's) linguistic ability to point out gotchas where A= da83's receiving-from-prior-exemplar does not conform to expectations of mo= dern OO inheritance. A simple mental hygiene of not (ab)using a term (i.e., "inherit")=C2=A0wher= e it shouldn't have been utilized in specifying Ada causes the entire OP's = gotcha to go poof. Conversely, over the years since the advent of the Ada9X project, the ARG d= id an excellent job of overtly capturing what inheritance means for tagged = types: the canonical OO definition of single inheritance without multiple = dispatch with zero or more inherited interfaces. It has none of Ada83-subt= yping's piecemeal dismantling of the enchilada via rules to copy-from-exemp= lar some piecepart-internals of the enchilada but not others. Why? Becaus= e inheritance doesn't do that (but subtyping's rule-based copy-from-exempla= r does).