comp.lang.ada
 help / color / mirror / Atom feed
* Using the Hash function
@ 2011-07-21 14:40 iloAda
  2011-07-21 14:57 ` Simon Wright
  2011-07-22  6:33 ` Stephen Leake
  0 siblings, 2 replies; 4+ messages in thread
From: iloAda @ 2011-07-21 14:40 UTC (permalink / raw)


Hello everybody!!

I am trying to use the hash function of the Unbounded_Strings package!

Here's the code (very simple):

1   function Unbounded_String_Hash
2    (U_Str : Ada.Strings.Unbounded.Unbounded_String)
3      return Ada.Containers.Hash_Type
4   is
5
6   begin
7
8    return Ada.Strings.Unbounded.Hash (U_Str);
9   end Unbounded_String_Hash;

I is giving me the following error on line 8 when I try to compile:
missing "with Unbounded.Hash";


Can anybody tell me what's going on (knowing that Unbounded.Hash isn(t
an existing package)!!

Thanks

Elie



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

* Re: Using the Hash function
  2011-07-21 14:40 Using the Hash function iloAda
@ 2011-07-21 14:57 ` Simon Wright
  2011-07-22  6:33 ` Stephen Leake
  1 sibling, 0 replies; 4+ messages in thread
From: Simon Wright @ 2011-07-21 14:57 UTC (permalink / raw)


iloAda <egzgheib@gmail.com> writes:

> Hello everybody!!
>
> I am trying to use the hash function of the Unbounded_Strings package!
>
> Here's the code (very simple):
>
> 1   function Unbounded_String_Hash
> 2    (U_Str : Ada.Strings.Unbounded.Unbounded_String)
> 3      return Ada.Containers.Hash_Type
> 4   is
> 5
> 6   begin
> 7
> 8    return Ada.Strings.Unbounded.Hash (U_Str);
> 9   end Unbounded_String_Hash;
>
> I is giving me the following error on line 8 when I try to compile:
> missing "with Unbounded.Hash";
>
>
> Can anybody tell me what's going on (knowing that Unbounded.Hash isn(t
> an existing package)!!
>
> Thanks
>
> Elie

You need to say

   with Ada.Strings.Unbounded.Hash;

as well as Ada.Containers.



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

* Re: Using the Hash function
  2011-07-21 14:40 Using the Hash function iloAda
  2011-07-21 14:57 ` Simon Wright
@ 2011-07-22  6:33 ` Stephen Leake
  2011-07-22  8:29   ` iloAda
  1 sibling, 1 reply; 4+ messages in thread
From: Stephen Leake @ 2011-07-22  6:33 UTC (permalink / raw)


iloAda <egzgheib@gmail.com> writes:

> Hello everybody!!
>
> I am trying to use the hash function of the Unbounded_Strings package!
>
> Here's the code (very simple):
>
> 1   function Unbounded_String_Hash
> 2    (U_Str : Ada.Strings.Unbounded.Unbounded_String)
> 3      return Ada.Containers.Hash_Type
> 4   is
> 5
> 6   begin
> 7
> 8    return Ada.Strings.Unbounded.Hash (U_Str);
> 9   end Unbounded_String_Hash;
>
> I is giving me the following error on line 8 when I try to compile:
> missing "with Unbounded.Hash";
>
>
> Can anybody tell me what's going on (knowing that Unbounded.Hash isn(t
> an existing package)!!

It isn't a package, it's a function. But it is declared at library
level, as a separate compilation unit. So it needs a 'with' clause.

-- 
-- Stephe



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

* Re: Using the Hash function
  2011-07-22  6:33 ` Stephen Leake
@ 2011-07-22  8:29   ` iloAda
  0 siblings, 0 replies; 4+ messages in thread
From: iloAda @ 2011-07-22  8:29 UTC (permalink / raw)


On Jul 22, 8:33 am, Stephen Leake <stephen_le...@stephe-leake.org>
wrote:
> iloAda <egzgh...@gmail.com> writes:
> > Hello everybody!!
>
> > I am trying to use the hash function of the Unbounded_Strings package!
>
> > Here's the code (very simple):
>
> > 1   function Unbounded_String_Hash
> > 2    (U_Str : Ada.Strings.Unbounded.Unbounded_String)
> > 3      return Ada.Containers.Hash_Type
> > 4   is
> > 5
> > 6   begin
> > 7
> > 8    return Ada.Strings.Unbounded.Hash (U_Str);
> > 9   end Unbounded_String_Hash;
>
> > I is giving me the following error on line 8 when I try to compile:
> > missing "with Unbounded.Hash";
>
> > Can anybody tell me what's going on (knowing that Unbounded.Hash isn(t
> > an existing package)!!
>
> It isn't a package, it's a function. But it is declared at library
> level, as a separate compilation unit. So it needs a 'with' clause.
>
> --
> -- Stephe

Ok....thanks guys!!



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

end of thread, other threads:[~2011-07-22  8:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-21 14:40 Using the Hash function iloAda
2011-07-21 14:57 ` Simon Wright
2011-07-22  6:33 ` Stephen Leake
2011-07-22  8:29   ` iloAda

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