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=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,fdbf6f8330ffcbf5 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!postnews.google.com!o15g2000prh.googlegroups.com!not-for-mail From: Adam Beneschan Newsgroups: comp.lang.ada Subject: Re: Odd/Broken behavior DOTNET-GNAT vs GNAT regarding tagged types. Date: Fri, 22 Oct 2010 16:20:17 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: <512951a6-bcc3-4c1a-a5ce-5bd3402d7143@j25g2000yqa.googlegroups.com> <8f6d51ed-69f9-4e76-a03e-b5601aa714e1@w30g2000prj.googlegroups.com> <4c89d345-c3ce-4ac4-a9d1-c1c93727f819@h7g2000yqn.googlegroups.com> NNTP-Posting-Host: 66.126.103.122 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1287789617 8193 127.0.0.1 (22 Oct 2010 23:20:17 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 22 Oct 2010 23:20:17 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: o15g2000prh.googlegroups.com; posting-host=66.126.103.122; posting-account=duW0ogkAAABjRdnxgLGXDfna0Gc6XqmQ User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; WOW64; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.21022; .NET CLR 3.5.30729; .NET CLR 3.0.30618; .NET4.0C),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:14689 Date: 2010-10-22T16:20:17-07:00 List-Id: On Oct 22, 12:58=A0pm, Shark8 wrote: > On Oct 22, 10:22=A0am, Adam Beneschan wrote: > > > > > > > On Oct 21, 8:35=A0pm, Shark8 wrote: > > > > Hey everyone; I just got bit with a bit of a surprise regarding the > > > differences in how tagged types are treated by GNAT vs DOTNET-GNAT, > > > The output of 'external_tag shows why the behavior of the Ada.Tags > > > Package is broken under DOTNET. > > > Not sure what you're trying to do here, or why this is causing a > > problem. =A0The RM says that the default 'External_Tag is implementatio= n- > > defined, so you shouldn't depend on it being a certain value, or else > > you should write your own "for Tagged_Base'External_Tag use ..." > > clause. =A0My apologies if you already knew this and had some other > > reason for being surprised. > > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 -- = Adam > > > [snip] > > > > -- .NET output > > > ---------------------- > > > C:\PROGRA~3\TEMPOR~1\testing>tag_error.exe > > > External tag for base type: tagged_base_pkg.tagged_base > > > External tag for child type: tagged_base_pkg.tagged_child > > > > Tagged child is NOT a decendant. > > > > -- Native output > > > ---------------------- > > > C:\PROGRA~3\TEMPOR~1\testing>tag_error.exe > > > External tag for base type: TAGGED_BASE_PKG.TAGGED_BASE > > > External tag for child type: TAGGED_BASE_PKG.TAGGED_CHILD > > > > Tagged child is a decendant. > > Ah, the only reason there's an 'External_Tag reference is for output > onscreen display {lazy shortcutting of > Ada.Tags.External_Tag(Item'Tag), which should give the same thing}; > the real oddity is the behavior of Is_Descendant_At_Same_Level which > doesn't readily appear to use the external formatting of the tag. Is_Descendant_At_Same_Level does appear to be wrong in the DOTNET-GNAT version. However, as an implementor, I would be very surprised if Is_Descendant_At_Same_Level tries to use external tags to compute the result. I guess that's why I was confused by your original statement, that the difference in external tag behavior "shows why the behavior" of Is_Descendant_At_Same_level is broken. It should be unrelated. -- Adam