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:9c8f:: with SMTP id f137-v6mr3982753ioe.27.1527801055820; Thu, 31 May 2018 14:10:55 -0700 (PDT) X-Received: by 2002:aca:c74c:: with SMTP id x73-v6mr200862oif.12.1527801055461; Thu, 31 May 2018 14:10:55 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!news.linkpendium.com!news.linkpendium.com!news.snarked.org!border2.nntp.dca1.giganews.com!nntp.giganews.com!u74-v6no1270606itb.0!news-out.google.com!b185-v6ni1343itb.0!nntp.google.com!u74-v6no1270602itb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Thu, 31 May 2018 14:10:55 -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: <534965d3-e494-476b-8a91-6cf9f376c020@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <37019e2f-b374-483a-aa62-4a76dcc568f6@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 21:10:55 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: reader02.eternal-september.org comp.lang.ada:52822 Date: 2018-05-31T14:10:55-07:00 List-Id: On Thursday, May 31, 2018 at 2:59:48 PM UTC-5, Dmitry A. Kazakov wrote: > On 2018-05-31 20:53, Dan'l Miller wrote: > > 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: = no > >>> =C2=A0additional data/cardinality-of-the-members-of-the-set, no addi= tional > >> =C2=A0>=C2=A0routines/behavior, no arbitrary refinement of behavior o= f overridden/copied > >>> =C2=A0routines/operations. Instead, subtyping in Ada is strictly su= bjecting the > >>> =C2=A0parent type to an additional membership-narrowing predicate, s= uch as subset > >> =C2=A0>=C2=A0in set theory. Randy likewise spoke of membership on ot= her branches of this > >> =C2=A0>=C2=A0thread. > >> > >> Untrue. Ada 83 subtyping extends the supertype (base type), because it > >> exports operations defined on the subtype to the base type. Ada 83 > >> subtyping introduces an equivalent type, which is both sub- and > >> supertype of the base. > >=20 > > If Ada83 untagged subtyping is type extension, please provide even a si= ngle characteristic that was extended/added/supplemented instead of contrac= ted/subtracted/elided by the predicate. >=20 > Elementary: >=20 > subtype Extension is Integer; > procedure Extended_Operation (X : Extension) is null; > X : Integer; > Y : Extension; > begin > Extended_Operation (X); -- See #1 > Extended_Operation (Y); -- See #2 There is exactly one procedure Extended_Operation, which despite its clever= ly-deceptive name is not a demonstration of type extension: We start with = having a single procedure that takes X as a parameter and that is precisely= where we end: no new procedure for Y, no additional storage for Y beyond = Y's Xness, no new outcome in the execution of that procedure when passed a = Y (except enforcement of the [unfortunately-missing] predicate as a post-co= ndition). Or in fewer words: nothing about Y is X-plus-more. There is no "more" the= re. (not even a predicate to enforce, which would have made this example a tad = juicier). > The subtype Extension extends Integer with Extended_Operation, which has= =20 > two separate meanings: >=20 > 1. The base type Integer has now a new operation: >=20 > new Integer interface =3D old Integer interface + Extended_Operation >=20 > 2. The subtype Extension extends inherited Integer's set of operations: >=20 > Extended interface =3D old Integer interface + Extended_Operation Invoking the same subprogram again (even with a potentially-created tempora= ry) is not adding something to X to make a bigger-better Y. Type extension= needs some sort of =E2=80=A2extension=E2=80=A2 whatsoever. Extension what= soever needs something extant to have been added/supplemented/made-more-of-= it, e.g., additional storage, additional subprograms (not the same one invo= ked twice), additional something-quantifiable or something-tangible beyond = mere narrowed post-condition range enforcement and beyond mere temporary cr= eation iff Y's representation were to differ from X's (due to some range-re= striction predicate, which was unfortunately omitted here). Perhaps something is getting lost in translation to a nonEnglish language a= t the fundamental meaning-of-words level:=C2=A0=C2=A0extend is ex- (outside= of)=C2=A0+ -tend (to regularly have a characteristic) so, by those lexemes= , Y extends X directly means Y regularly has a characteristic outside of X,= where characteristic is not empty set and where "outside of X" is beyond X= 's well-defined perimeter of self that demarcates X from all things not-X i= n the universe. Y has no such extant characteristic that you or I can poin= t to (e.g., what's its name?; where's its storage?; what's its lifetime?) t= hat exists somewhere/anywhere in the not-X universe. (And I don't count Y'= s would-be predicate, because the entire purpose of the predicate is to be = subtractive/restrictive to be less-of-X, not expansively X-plus-more.) Y merely copied some characteristics (but not others, depending on the woul= d-be predicate) from a prior exemplar named X. Y can be utilized wherever = the exemplar was utilized. Nothing more. And it is that "more" there for = which we are so desperately looking: the extant expansionistic/not-contrac= tionistic thingy that Y tended to be outside of being an X. Y needs to fin= d that quantifiable/tangible extant thingy outside of being an X to be an e= xtension, to then in turn be type extension. Nothing in Y outside of its X= ness would imply no extension. No extension would imply no type extension = in Ada83's subtyping. No type extension would imply no inheritance in Ada8= 3's subtyping. And when we went on that safari-hunt for that "more" thingy= there, we found "nothing". Nothing is not an extant thingy. That chain o= f sought-for implications are thus true. Q.E.D.