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,80435549e92d4e0c X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!newshub.sdsu.edu!elnk-nf2-pas!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!stamper.news.atl.earthlink.net!newsread3.news.atl.earthlink.net.POSTED!14bb18d8!not-for-mail Sender: mheaney@MHEANEYX200 Newsgroups: comp.lang.ada Subject: Re: Charles container library usage examples References: <1125827360.091136.285250@g47g2000cwa.googlegroups.com> 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: Wed, 07 Sep 2005 00:15:53 GMT NNTP-Posting-Host: 24.149.57.125 X-Complaints-To: abuse@earthlink.net X-Trace: newsread3.news.atl.earthlink.net 1126052153 24.149.57.125 (Tue, 06 Sep 2005 17:15:53 PDT) NNTP-Posting-Date: Tue, 06 Sep 2005 17:15:53 PDT Organization: EarthLink Inc. -- http://www.EarthLink.net Xref: g2news1.google.com comp.lang.ada:4491 Date: 2005-09-07T00:15:53+00:00 List-Id: David Trudgett writes: > Yep. I used the ordered map instead of the hashed map. By the way, > does Charles have general purpose hashing functions, or do you need to > roll your own? I thought I saw a string hash function in PragmARC. Is > it suitable for use in Charles? Charles has a hash function for type String; see the files: charles-hash_string.ad[sb] There's also a hash function for type Integer: charles-hash_integer.ad[sb] In your case, you have an integer key, so you can use the Hash_Integer function already provided by Charles. Except for Hash_String and Hash_Integer, there are no "general-purpose" hash functions, since writing a hash function often requires a modest amount of tuning over expected inputs. -Matt