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:a24:a141:: with SMTP id n1-v6mr4971460iti.35.1527861690269; Fri, 01 Jun 2018 07:01:30 -0700 (PDT) X-Received: by 2002:aca:abc6:: with SMTP id u189-v6mr293971oie.2.1527861689640; Fri, 01 Jun 2018 07:01:29 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!news.unit0.net!newsreader5.netcologne.de!news.netcologne.de!peer01.ams1!peer.ams1.xlned.com!news.xlned.com!peer01.am4!peer.am4.highwinds-media.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!v8-v6no2031085itc.0!news-out.google.com!f20-v6ni1255itd.0!nntp.google.com!u74-v6no2042333itb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Fri, 1 Jun 2018 07:01:29 -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> <37019e2f-b374-483a-aa62-4a76dcc568f6@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <2968eca4-8f5a-4480-967b-1488a6c054fa@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: Fri, 01 Jun 2018 14:01:30 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Received-Bytes: 7133 X-Received-Body-CRC: 949848627 Xref: reader02.eternal-september.org comp.lang.ada:52841 Date: 2018-06-01T07:01:29-07:00 List-Id: On Friday, June 1, 2018 at 2:56:55 AM UTC-5, Dmitry A. Kazakov wrote: > On 2018-05-31 11:10 PM, Dan'l Miller wrote: > > 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 wro= te: > >>>> 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 a= dditional > >>>> =C2=A0>=C2=A0routines/behavior, no arbitrary refinement of behavio= r of overridden/copied > >>>>> =C2=A0routines/operations. Instead, subtyping in Ada is strictly= subjecting 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 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. > >>> > >>> If Ada83 untagged subtyping is type extension, please provide even a = single characteristic that was extended/added/supplemented instead of contr= acted/subtracted/elided by the predicate. > >> > >> Elementary: > >> > >> 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 > >=20 > > There is exactly one procedure Extended_Operation, which despite its cl= everly-deceptive name is not a demonstration of type extension: We start w= ith having a single procedure that takes X as a parameter and that is preci= sely where we end: no new procedure for Y, no additional storage for Y bey= ond Y's Xness, no new outcome in the execution of that procedure when passe= d a Y (except enforcement of the [unfortunately-missing] predicate as a pos= t-condition). >=20 > Interface was extended. Implementation details as to how many bodies=20 > there will be used are irrelevant. >=20 > > Or in fewer words: nothing about Y is X-plus-more. There is no "more"= there. > > (not even a predicate to enforce, which would have made this example a = tad juicier). > >=20 > >> The subtype Extension extends Integer with Extended_Operation, which h= as > >> two separate meanings: > >> > >> 1. The base type Integer has now a new operation: > >> > >> new Integer interface =3D old Integer interface + Extended_Operat= ion > >> > >> 2. The subtype Extension extends inherited Integer's set of operations= : > >> > >> Extended interface =3D old Integer interface + Extended_Operation > >=20 > > Invoking the same subprogram >=20 > Same to what? The interface of Integer as defined by the standard does=20 > not have Extended_Operation. How is it same? (How clever that you snipped my already-existing answer to your question at= precisely the word where it becomes the inconvenient answer. The elided o= riginal answer is restored as the next quotation below.) Extended_Operation is merely invoked twice. Extended_Operation is =E2=80= =A2the same=E2=80=A2 as itself, regardless if passed X as an argument or pa= ssed Y as an argument. If Extended_Operation were named GiveTheKidABath instead, it would be obvio= us to all readers that giving two kids {X, Y} a bath, does not extend Y by = growth and does not extend the size of the family by birthing more babies. = Nothing whatsoever was extended by invoking Extended_Operation against bot= h X and Y. Despite its cleverly-deceptive name (and despite invoking that = subprogram twice), there is no extension whatsoever in Y beyond Y's Xness. = If Y was declared with a predicate, then Y would actually demonstrate some= contraction of Xness. Contraction (smaller domain) is not extension (bigg= er size or bigger mission) either. > Invoking the same subprogram again (even with a potentially-created tempo= rary) 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.=20 > Extension whatsoever needs something extant to have been added/supplement= ed/made-more-of-it, > e.g., additional storage, additional subprograms (not the same one invoke= d twice), additional something > quantifiable or something-tangible beyond mere narrowed post-condition ra= nge enforcement and > beyond mere temporary creation iff Y's representation were to differ from= X's (due to some range > restriction predicate, which was unfortunately omitted here).=20 Attention maintainers: the inability to determine the correct meaning of m= y =E2=80=9CInvoking the same subprogram again=E2=80=9D in the context of >> Extended_Operation (X); -- See #1=20 >> Extended_Operation (Y); -- See #2=20 is clearly failing the Turing test due to A-is-A or A-is-itself not being u= nderstood at all. Time flies like an arrow, but fruit flies like a banana,= eh? I think that this is crystal-clear evidence of what is going on here.