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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no 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-7-bit Path: g2news1.google.com!postnews.google.com!a37g2000yqi.googlegroups.com!not-for-mail From: Shark8 Newsgroups: comp.lang.ada Subject: Re: Odd/Broken behavior DOTNET-GNAT vs GNAT regarding tagged types. Date: Fri, 22 Oct 2010 18:57:16 -0700 (PDT) Organization: http://groups.google.com Message-ID: <76b529fa-ec7e-4722-a883-3ff8869fe061@a37g2000yqi.googlegroups.com> 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: 174.28.203.45 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: posting.google.com 1287799037 21818 127.0.0.1 (23 Oct 2010 01:57:17 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sat, 23 Oct 2010 01:57:17 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: a37g2000yqi.googlegroups.com; posting-host=174.28.203.45; posting-account=lJ3JNwoAAAAQfH3VV9vttJLkThaxtTfC User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2.10) Gecko/20100914 Firefox/3.6.10 ( .NET CLR 3.5.30729; .NET CLR 4.0.20506),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:14690 Date: 2010-10-22T18:57:16-07:00 List-Id: On Oct 22, 5:20 pm, Adam Beneschan wrote: > > 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 Sadly, "should" and "are" are often significantly different. :( Anyway, I did some poking around and, on opening the Ada.Tags.ADB file, here's what I found: package body Ada.Tags is type String_Access is access all String; ------------------- -- CW_Membership -- ------------------- function CW_Membership (Obj_Tag : Tag; Typ_Tag : Tag) return Boolean is begin -- ??? This needs to be implemented raise Program_Error; return False; end CW_Membership; ------------------- -- Expanded_Name -- ------------------- function Expanded_Name (T : Tag) return String is function Ada_Name (T : Tag) return String_Access; pragma Import (CIL, Ada_Name, "mgnat.adalib.GNAT_libc.ada_name"); begin return Ada_Name (T).all; end Expanded_Name; ------------------ -- External_Tag -- ------------------ function External_Tag (T : Tag) return String is function Ext_Tag (T : Tag) return String_Access; pragma Import (CIL, Ext_Tag, "mgnat.adalib.GNAT_libc.external_tag"); begin return Ext_Tag (T).all; end External_Tag; ------------------ -- Internal_Tag -- ------------------ function Internal_Tag (External : String) return Tag is function Int_Tag (External : String) return Tag; pragma Import (CIL, Int_Tag, "mgnat.adalib.GNAT_libc.internal_tag"); begin return Int_Tag (External); exception when others => raise Tag_Error; end Internal_Tag; -------------------- -- Descendant_Tag -- -------------------- function Descendant_Tag (External : String; Ancestor : Tag) return Tag is pragma Unreferenced (Ancestor); begin -- ??? This needs to be implemented return Internal_Tag (External); end Descendant_Tag; --------------------------------- -- Is_Descendant_At_Same_Level -- --------------------------------- function Is_Descendant_At_Same_Level (Descendant : Tag; Ancestor : Tag) return Boolean is pragma Unreferenced (Descendant, Ancestor); begin -- ??? This needs to be implemented return False; end Is_Descendant_At_Same_Level; ---------------- -- Parent_Tag -- ---------------- function Parent_Tag (T : Tag) return Tag is begin -- ??? This needs to be implemented return T; end Parent_Tag; end Ada.Tags; I think it is safe to say the culprit is this: "-- ??? This needs to be implemented" Yeah, "not-implemented" is the same as "doesn't work" in many cases.