comp.lang.ada
 help / color / mirror / Atom feed
* Novice Ada Programmer Stumped By Simple Type Declaration!
@ 2001-10-04 19:19 Darren New
  2001-10-04 19:50 ` Ted Dennison
  0 siblings, 1 reply; 10+ messages in thread
From: Darren New @ 2001-10-04 19:19 UTC (permalink / 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?



^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2001-10-07 20:50 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-10-04 19:19 Novice Ada Programmer Stumped By Simple Type Declaration! Darren New
2001-10-04 19:50 ` 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

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