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-27 13:24:20 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: mheaney@on2.com (Matthew Heaney) Newsgroups: comp.lang.ada Subject: Re: using charles library Date: 27 May 2003 13:24:20 -0700 Organization: http://groups.google.com/ Message-ID: <1ec946d1.0305271224.7f4b3b0f@posting.google.com> References: NNTP-Posting-Host: 66.162.65.162 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1054067060 30223 127.0.0.1 (27 May 2003 20:24:20 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 27 May 2003 20:24:20 GMT Xref: archiver1.google.com comp.lang.ada:37861 Date: 2003-05-27T20:24:20+00:00 List-Id: rm@gunlab.com.ru (Roman V. Isaev) wrote in message news:... > 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 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")); > > > When I try to compile I get following error: The parameter name is incorrect (as was already pointed out), but you also need a use clause: TT : Translation_Tables.Container_Type; use Translation_Tables; ... Insert (TT, "key", To_Container ("value")); If you're manipulating string containers (Charles.Strings.Unbounded, etc), then it may be easier to define a conversion operator: function "+" (S : String) return Charles.Strings.Unbounded.Container_Type renames To_Container; This allows you to say: Insert (TT, "key", +"value"); In C++, the string ctor allows type conversions be made silently (i.e. there is no syntactic penalty), but Ada requires type conversions to be explicit.