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 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!mx05.eternal-september.org!feeder.eternal-september.org!nuzba.szn.dk!news.jacob-sparre.dk!munin.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Is this expected behavior or not Date: Fri, 5 Apr 2013 20:45:40 -0500 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: <1u72u7h5j4jg3$.wlxmaltyzqik.dlg@40tude.net> <1gnmajx2fdjju.1bo28xwmzt1nr.dlg@40tude.net> <3gv2jwc95otm.pl2aahsh9ox8.dlg@40tude.net> <1gkxiwepaxvtt$.u3ly33rbwthf.dlg@40tude.net> <1fmcdkj58brky.bjedt0pr39cd$.dlg@40tude.net> <1bj564vat3q1j$.1s4d00rlzx4ux$.dlg@40tude.net> <4hzv51v872q2$.1imijbwd7heqm$.dlg@40tude.net> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: munin.nbi.dk 1365212741 1623 69.95.181.76 (6 Apr 2013 01:45:41 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Sat, 6 Apr 2013 01:45:41 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Xref: news.eternal-september.org comp.lang.ada:14885 Date: 2013-04-05T20:45:40-05:00 List-Id: wrote in message news:alpine.DEB.2.02.1304052103590.31746@debian... ... >OK, here we agree. Whatever the "new" strings are, the ability to define >incompatible types with the same representation, that you cannot mix >(without explicit conversion) is important for a language supporting >safety-critical stuff! I sometimes have types Tainted_String and >Save_String, being both derived from [Wide_[Wide_]]String, and I am happy >when the compiler stops me from messing up between variables of this type. >Does Randy's proposal really not allow that? Of course they're different types. They wouldn't be mixable amongst themselves (Dmitry's obcession with multi-methods would of course erode any such protections). They both would implicitly convert to Root_String'Class, of course, and there wouldn't be any way to prevent that. But I can't see any particular new problem with this, you have the same effect for any Ada tagged type and associated class-wide type. I know Dmitry would like to have some sort of way to split off clones of types that are completely incompatible, but that would have severe consequences with the other uses for type hierarchies (conversions and formal types), as those could not be allowed either. Randy.