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:1f51:: with SMTP id f78-v6mr5789541iof.51.1529957640114; Mon, 25 Jun 2018 13:14:00 -0700 (PDT) X-Received: by 2002:aca:c6ca:: with SMTP id w193-v6mr213543oif.1.1529957639975; Mon, 25 Jun 2018 13:13:59 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!news.uzoreto.com!weretis.net!feeder6.news.weretis.net!feeder.usenetexpress.com!feeder-in1.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!u78-v6no50781itb.0!news-out.google.com!z3-v6ni22iti.0!nntp.google.com!u78-v6no50780itb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Mon, 25 Jun 2018 13:13:59 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=47.185.195.62; posting-account=zwxLlwoAAAChLBU7oraRzNDnqQYkYbpo NNTP-Posting-Host: 47.185.195.62 References: <5e86db65-84b9-4b5b-9aea-427a658b5ae7@googlegroups.com> <878t7u1cfm.fsf@nightsong.com> <776f3645-ed0c-4118-9b4d-21660e3bba4b@googlegroups.com> <87602fbu2g.fsf@nightsong.com> <87po0mziqt.fsf@nightsong.com> <87fu1izfgs.fsf@nightsong.com> <878t75nwad.fsf@adaheads.home> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <4bdf7c54-e7e9-427a-ad69-149f10ba1fb3@googlegroups.com> Subject: Re: Ada Successor Language From: "Dan'l Miller" Injection-Date: Mon, 25 Jun 2018 20:14:00 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: reader02.eternal-september.org comp.lang.ada:53313 Date: 2018-06-25T13:13:59-07:00 List-Id: On Monday, June 25, 2018 at 2:16:36 PM UTC-5, Niklas Holsti wrote: > On 18-06-25 17:21 , Dmitry A. Kazakov wrote: > > On 2018-06-25 16:03, Niklas Holsti wrote: > > > >> (In fact, it seems to me that Ada could allow untagged record > >> extensions as well; the effect would be the same as for tagged ones, > >> but no 'Class would be formed, and no class-wide programming or > >> dynamic dispatch could be used, so all such types would be static. > > > > Ada could allow T'Class for untagged T. T'Class would be an indefinite > > type with values consisting of the actual type's tag and its value. Whe= n > > T is by-value type, you pass T'Class to a subprogram as tag + value. > > When T is by-reference type, you pass tag + reference. >=20 > Yes, that could be another point in the division of the "OO programming= =20 > concept" into smaller, more "primitive" features -- building blocks --=20 > which could be combined in various ways. >=20 > Your suggestion would allow class-wide programming without storing tags= =20 > _in_ objects. The programmer promising to correctly store the right tag outside of object= s would be a new level of human achievement in defeating strong typing. It= would be a new level of (dubious-)achievement that not even C++ has=E2=80= =94and that is incredibly hard to contrive, because C++ is the goose that h= as laid so many rotten eggs! (Just when I thought C++ couldn't conceivably= plant any more landmines than it already has, the =E2=80=A2Ada=E2=80=A2 co= mmunity of all people devises an even worse one.) Please humor me. Just how would this outside-of-object flyweight-design-pa= ttern tag be kept strongly typed & typesafe? Would there be an XTag type t= hat corresponds one-to-one and onto 'Class-able untagged X type? How* woul= d XTag be made known to X at time of either X's or XTag's declaration? * i.e., what syntax?