comp.lang.ada
 help / color / mirror / Atom feed
From: Ted Dennison<dennison@telepath.com>
Subject: Re: Novice Ada Programmer Stumped By Simple Type Declaration!
Date: Thu, 04 Oct 2001 19:50:13 GMT
Date: 2001-10-04T19:50:13+00:00	[thread overview]
Message-ID: <V33v7.16265$ev2.26335@www.newsranger.com> (raw)
In-Reply-To: 3BBCB63C.96E484EA@san.rr.com

In article <3BBCB63C.96E484EA@san.rr.com>, Darren New says...
>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.

A good first step in any such problem is to get rid of all use clauses and try
to resolve things with full named notation. (I'd also claim that's a good first
step in *any* situation, but it really is true here :-)  ).

>package URI_pkg is
>  package URI_List_Pkg is new DNew.Unbounded_Array(Component_Type =>
>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 looks like you should be calling URI_Pkg.URI_List_Pkg.Append. But from the
message you gave, I'm guessing it found it but couldn't resolve the overload. It
could be that your compiler (Gnat?) was getting confused because you had two
Unbounded_Array's defined in its scope: One a package, and the other a subtype.
You'd think it should be able to sort that out, but I've seen other situations
where Gnat (3.13p) gets horribly confused by similarly named things. I could
never narrow the problem down enough to satify the report@gnat.com gods, but
rest asured the problem is in there.

---
T.E.D.    homepage   - http://www.telepath.com/dennison/Ted/TED.html

No trees were killed in the sending of this message. 
However a large number of electrons were terribly inconvenienced.



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

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-10-04 19:19 Novice Ada Programmer Stumped By Simple Type Declaration! Darren New
2001-10-04 19:50 ` Ted Dennison [this message]
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