From: Shark8 <onewingedshark@gmail.com>
Subject: Re: Odd/Broken behavior DOTNET-GNAT vs GNAT regarding tagged types.
Date: Fri, 22 Oct 2010 18:57:16 -0700 (PDT)
Date: 2010-10-22T18:57:16-07:00 [thread overview]
Message-ID: <76b529fa-ec7e-4722-a883-3ff8869fe061@a37g2000yqi.googlegroups.com> (raw)
In-Reply-To: bcf3d59a-f6b5-4c1c-a3c7-918cbe610647@o15g2000prh.googlegroups.com
On Oct 22, 5:20 pm, Adam Beneschan <a...@irvine.com> 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.
next prev parent reply other threads:[~2010-10-23 1:57 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-22 3:35 Odd/Broken behavior DOTNET-GNAT vs GNAT regarding tagged types Shark8
2010-10-22 8:01 ` Georg Bauhaus
2010-10-22 16:22 ` Adam Beneschan
2010-10-22 19:58 ` Shark8
2010-10-22 23:20 ` Adam Beneschan
2010-10-23 1:57 ` Shark8 [this message]
2010-10-25 15:34 ` Adam Beneschan
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox