comp.lang.ada
 help / color / mirror / Atom feed
From: Darren New <dnew@san.rr.com>
Subject: Novice Ada Programmer Stumped By Simple Type Declaration!
Date: Thu, 04 Oct 2001 19:19:37 GMT
Date: 2001-10-04T19:19:37+00:00	[thread overview]
Message-ID: <3BBCB63C.96E484EA@san.rr.com> (raw)

Here's the basics of what I have --

I have a generic package called DNew.Unbounded_Array, with a formal
private type being the components of the array. (This is roughly
analogous to Unbounded_String only with non-character components.)

I then have
package URI_pkg is
  type URI is new Unbounded_String;
  package URI_List_Pkg is new DNew.Unbounded_Array(Component_Type =>
URI);
  subtype URI_List is URI_List_Pkg.Unbounded_Array;
  function To_URI(S : String) return URI;


Now, DNew.Unbounded_Array defines a type called Unbounded_Array (of
course), as well as 
procedure Append(X : in out Unbounded_Array; Y : in Component_type);
procedure Append(X : in out Unbounded_Array; Y : in Unbounded_Array);


The problem comes when, in an unrelated package, I have

procedure test1 is
  U : URI := To_URI("http://...");
  UL : URI_List;
begin
  Append(UL, U);
end test1;

It seems no matter what "with" and "use" clauses I use, it can't resolve
the Append to be the appropriate one. GNAT gives all kinds of errors,
none of which make much sense.

test-beep_core_profile_registry_pkg.adb:42:26: no candidate
interpretations match the actuals:
test-beep_core_profile_registry_pkg.adb:42:34: expected private type
"URI" defined at beep-core-uri_pkg.ads:8
test-beep_core_profile_registry_pkg.adb:42:34: found private type
"Unbounded_Array" defined at dnew-util-unbounded_array_pkg.ads:13,
instance at beep-core-uri_pkg.ads:10
test-beep_core_profile_registry_pkg.adb:42:34:   ==> in call to "Append"
at beep
-core-uri_pkg.ads:8(inherited)

I believe it may be expecting the Append from Unbounded_String and
getting confused. 

Any help, from anyone? 

The complete set of sources are available at
http://home.san.rr.com/dnew/beepcore.zip.

Thanks in advance for any advice!

-- 
Darren New 
San Diego, CA, USA (PST). Cryptokeys on demand.
                   Who is this Dr. Ibid anyway, 
                  and how does he know so much?



             reply	other threads:[~2001-10-04 19:19 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-10-04 19:19 Darren New [this message]
2001-10-04 19:50 ` Novice Ada Programmer Stumped By Simple Type Declaration! Ted Dennison
2001-10-04 21:33   ` Darren New
2001-10-05 15:27     ` Ted Dennison
2001-10-06  8:56     ` Simon Wright
2001-10-07 17:07       ` Darren New
2001-10-07 20:50         ` Lutz Donnerhacke
2001-10-05  4:32   ` Robert Dewar
2001-10-05 15:19     ` Ted Dennison
2001-10-05 16:30       ` Darren New
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox