comp.lang.ada
 help / color / mirror / Atom feed
* Ada Containers
@ 2012-10-07 19:58 rwilco19
  2012-10-07 20:40 ` Maciej Sobczak
  2012-10-07 22:00 ` Simon Wright
  0 siblings, 2 replies; 8+ messages in thread
From: rwilco19 @ 2012-10-07 19:58 UTC (permalink / raw)


Can someone please explain to me the difference between Ada.Containers.Hashed_Tables and Ada.Containers.Hashed_Maps, and when you might want to use a Hashed_Table over a Hashed_Map?



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

* Re: Ada Containers
  2012-10-07 19:58 Ada Containers rwilco19
@ 2012-10-07 20:40 ` Maciej Sobczak
  2012-10-07 21:25   ` rwilco19
  2012-10-07 21:30   ` rwilco19
  2012-10-07 22:00 ` Simon Wright
  1 sibling, 2 replies; 8+ messages in thread
From: Maciej Sobczak @ 2012-10-07 20:40 UTC (permalink / raw)


W dniu niedziela, 7 października 2012 21:58:41 UTC+2 użytkownik rwil...@gmail.com napisał:

> Can someone please explain to me the difference between Ada.Containers.Hashed_Tables and Ada.Containers.Hashed_Maps,

Yes, it is very easy - Hashed_Tables does not exists at all, whereas Hashed_Maps is a pretty useful package. :-)

Did you perhaps meant some other package? Which one?

-- 
Maciej Sobczak * http://www.msobczak.com * http://www.inspirel.com



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

* Re: Ada Containers
  2012-10-07 20:40 ` Maciej Sobczak
@ 2012-10-07 21:25   ` rwilco19
  2012-10-11 18:31     ` Martin
  2012-10-07 21:30   ` rwilco19
  1 sibling, 1 reply; 8+ messages in thread
From: rwilco19 @ 2012-10-07 21:25 UTC (permalink / raw)


Do you mean doesn't exist, or cannot be used?

Here's a reference page for it:
http://www.martin.dowie.btinternet.co.uk/Containers/adabrowse/ada-containers-hash_tables.html

This page shows it in the dependency list for Hashed_Maps
http://www.martin.dowie.btinternet.co.uk/Containers/adabrowse/ada-containers-hashed_maps.html

"with Ada.Containers.Hash_Tables;"



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

* Re: Ada Containers
  2012-10-07 20:40 ` Maciej Sobczak
  2012-10-07 21:25   ` rwilco19
@ 2012-10-07 21:30   ` rwilco19
  2012-10-07 21:56     ` Georg Bauhaus
  1 sibling, 1 reply; 8+ messages in thread
From: rwilco19 @ 2012-10-07 21:30 UTC (permalink / raw)


Maby I caused some confusion earlier with a type. I misspelled the package name. It's Ada.Containers.Hash_Tables not Ada.Containers.Hashed_Tables.



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

* Re: Ada Containers
  2012-10-07 21:30   ` rwilco19
@ 2012-10-07 21:56     ` Georg Bauhaus
  0 siblings, 0 replies; 8+ messages in thread
From: Georg Bauhaus @ 2012-10-07 21:56 UTC (permalink / raw)


On 07.10.12 23:30, rwilco19@gmail.com wrote:
> Maby I caused some confusion earlier with a type. I misspelled the package name. It's Ada.Containers.Hash_Tables not Ada.Containers.Hashed_Tables.
>

In GNAT, package Ada.Containers.Hash_Tables
"declares the hash-table type used to implement hashed containers."

In Ada, the hashed containers are Ada.Containers.Hashed_Maps
and Ada.Containers.Hashed_Sets, and variants like Bounded_*
(new in Ada 2012) and Indefinite_*. So Hash_Tables is part of
GNAT's implementation of Ada's hashed containers, perhaps for
use by implementers only.

(You can see in the sources of GNAT's implementation of
Ada's library, this context clause in Ada.Containers.Hashed_Maps:

(private with Ada.Containers.Hash_Tables;)




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

* Re: Ada Containers
  2012-10-07 19:58 Ada Containers rwilco19
  2012-10-07 20:40 ` Maciej Sobczak
@ 2012-10-07 22:00 ` Simon Wright
  1 sibling, 0 replies; 8+ messages in thread
From: Simon Wright @ 2012-10-07 22:00 UTC (permalink / raw)


rwilco19@gmail.com writes:

> Can someone please explain to me the difference between
> Ada.Containers.Hashed_Tables and Ada.Containers.Hashed_Maps, and when
> you might want to use a Hashed_Table over a Hashed_Map?

Ada.Containers.Hash_Tables, as you noted.

Hashed_Maps is in the Standard, Hash_Tables is not; it's part of
AdaCore's implementation (and maybe others, for all I know).

GCC 4.7.0 says for Hashed_Maps

   with Ada.Iterator_Interfaces;

   private with Ada.Containers.Hash_Tables;
   private with Ada.Finalization;
   private with Ada.Streams;

   generic
      type Key_Type is private;
      type Element_Type is private;

      with function Hash (Key : Key_Type) return Hash_Type;
      with function Equivalent_Keys (Left, Right : Key_Type) return Boolean;
      with function "=" (Left, Right : Element_Type) return Boolean is <>;

   package Ada.Containers.Hashed_Maps is

and you will see that Hash_Tables is withed privately (i.e., it's only
used in the private part, "not specified by the language").

A further clue: the comment at the start of Hash_Tables says "This
package declares the hash-table type used to implement hashed
containers."



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

* Re: Ada Containers
  2012-10-07 21:25   ` rwilco19
@ 2012-10-11 18:31     ` Martin
  2012-10-12 10:35       ` georg bauhaus
  0 siblings, 1 reply; 8+ messages in thread
From: Martin @ 2012-10-11 18:31 UTC (permalink / raw)


I should probably pull these pages down...that's 8 years old now and "real" versions are available.

-- Martin



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

* Re: Ada Containers
  2012-10-11 18:31     ` Martin
@ 2012-10-12 10:35       ` georg bauhaus
  0 siblings, 0 replies; 8+ messages in thread
From: georg bauhaus @ 2012-10-12 10:35 UTC (permalink / raw)


Martin <martin@thedowies.com> wrote:
> I should probably pull these pages down...that's 8 years old now and
> "real" versions are available.

They are good to have if you still
run nice Ada 95 compilers.



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

end of thread, other threads:[~2012-10-16  1:56 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-07 19:58 Ada Containers rwilco19
2012-10-07 20:40 ` Maciej Sobczak
2012-10-07 21:25   ` rwilco19
2012-10-11 18:31     ` Martin
2012-10-12 10:35       ` georg bauhaus
2012-10-07 21:30   ` rwilco19
2012-10-07 21:56     ` Georg Bauhaus
2012-10-07 22:00 ` Simon Wright

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