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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,74d953d10520ed5e X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-05-26 10:05:58 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.uchicago.edu!yellow.newsread.com!netaxs.com!newsread.com!newsfeed!news.tele.dk!news.tele.dk!small.news.tele.dk!uninett.no!ntnu.no!not-for-mail From: Preben Randhol Newsgroups: comp.lang.ada Subject: Re: using charles library Date: Mon, 26 May 2003 17:05:58 +0000 (UTC) Organization: Norwegian university of science and technology Message-ID: References: NNTP-Posting-Host: kiuk0152.chembio.ntnu.no X-Trace: tyfon.itea.ntnu.no 1053968758 28690 129.241.83.78 (26 May 2003 17:05:58 GMT) X-Complaints-To: usenet@itea.ntnu.no NNTP-Posting-Date: Mon, 26 May 2003 17:05:58 +0000 (UTC) User-Agent: slrn/0.9.7.4 (Linux) Xref: archiver1.google.com comp.lang.ada:37802 Date: 2003-05-26T17:05:58+00:00 List-Id: Roman V. Isaev wrote: >> > I'm learning the ropes, so it might be stupid question but I tried >> > use charles.maps.sorted.strings.unbounded (used sample code by >> > mheaney@on2.com from this newsgroup archive): >> > with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; >> > with Charles.Maps.Sorted.Strings.Unbounded; >> > with Charles.Strings.Unbounded; use Charles.Strings.Unbounded; >> > package body gettext is >> > package Translation_Tables is >> > new Charles.Maps.Sorted.Strings.Unbounded >> > (Element_Type => Charles.Strings.Unbounded.Container_Type); >> > TT : Translation_Tables.Container_Type; >> > ........ >> > procedure load_mo_file is >> > ........ >> > Insert(TT, "key", Element => To_Container("value")); >> Because it is: >> Insert(TT, "key", New_Item => To_Container("value")); >> as I can see from the .ads file although I haven't tried to compile >> this. > > It still complains: Ah because you have to do: Charles.Maps.Sorted.Strings.Unbounded.Insert (TT, "key", New_Item => To_Container("value")); as you are only withing the Charles.Maps.Sorted.Strings.Unbounded child package. Now it tries to find the Insert in Charles.Strings.Unbounded. I assume you are using the Insert from Charles.Maps.Sorted.Strings.Unbounded ? > I wonder is there any package easier to use? I only want two > functions, something like store(key,value) and lookup(key), that's > all, without 20+ string declaration voodoo... Grrrrr. I miss perl's > associative arrays. Relax, it is only that you are not so familiar with Ada. It doesn't have to do with the library. :-) -- Preben Randhol http://www.pvv.org/~randhol/