From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,41e60d168b455460 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!news.glorb.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!elnk-atl-nf1!newsfeed.earthlink.net!stamper.news.atl.earthlink.net!newsread2.news.atl.earthlink.net.POSTED!14bb18d8!not-for-mail Sender: mheaney@MHEANEYX200 Newsgroups: comp.lang.ada Subject: Re: Hash table References: From: Matthew Heaney Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 13 Aug 2005 23:58:43 GMT NNTP-Posting-Host: 165.121.144.182 X-Complaints-To: abuse@earthlink.net X-Trace: newsread2.news.atl.earthlink.net 1123977523 165.121.144.182 (Sat, 13 Aug 2005 16:58:43 PDT) NNTP-Posting-Date: Sat, 13 Aug 2005 16:58:43 PDT Organization: EarthLink Inc. -- http://www.EarthLink.net Xref: g2news1.google.com comp.lang.ada:4108 Date: 2005-08-13T23:58:43+00:00 List-Id: David Trudgett writes: > I'm looking for a Free Software Ada95 container library, or in > particular, a hash table (or associative list). Ada 2005 will have both sets and maps. You're asking specifically for a hashed version, but keep in mind that an ordered container (having an identical interface, but different time complexity) might satisfy your needs just as well. The hashed containers are: ada.containers.hashed_sets ada.containers.indefinite_hashed_sets ada.containers.hashed_maps ada.containers.indefinite_hashed_maps The ordered forms are: ada.containers.ordered_sets ada.containers.indefinite_ordered_sets ada.containers.ordered_maps ada.containers.indefinite_ordered_maps > I noticed that Ada 2005 may include a standard Ada.Containers library, > but is there a working prototype of this available now? Yes, there's a public reference implementation available here: http://charles.tigris.org/ Follow the links to the CVS repository, to the ai302 subdirectory. The names use gnat run-time syntax, so you're looking for: a-cohama.ad[sb] a-cihama.ad[sb] a-cohase.ad[sb] a-cihase.ad[sb] Note that these will only compile with an Ada 2005 compiler. If you're using the latest version of gnat, use the -gnat05 switch to compile them. If you don't have an Ada 2005 compiler, then you can modify the sources to your liking. That will mean replacing an anonymous access subprogram parameters with something else, typically a generic operation that passes the subprogram as a generic formal. For example, the procedure: procedure Iterate (Container : in Map; Process : not null access procedure (Position : Cursor)); should be re-written as: generic with procedure Process (Position : Cursor); procedure Generic_Iteration (Container : in Map); (Note that replacing the anonymous access subprogram parameters with named access parameters is probably not what you want, because of the accessibility rules. Hence the generic declaration above.) > A bit of searching found the ASL (Ada Structured Library -- > http://sourceforge.net/projects/adasl), which hasn't had a new release > since 2001 (which means it must be perfect ;-)). Should I use ASL, and > if I do, will it be completely different from the proposed > Ada.Containers standard? I would try to use a reference implementation of the standard library, modified as necessary to run under pure Ada 95. I can help you make the necessary modifications. In general, we prefer that users use the standard library now, since that helps us find bugs in the design of the library (early adopters have been extremely helpful here), and in the actual implementation of the library. > I'm using Gnat (3.15p) on Debian Linux. Do you have access to gcc 4.x? The standard container library is already bundled with the gcc 4 release. -Matt