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,a3736685ef876ab2 X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!sn-xt-sjc-04!sn-xt-sjc-09!sn-post-sjc-01!supernews.com!corp.supernews.com!not-for-mail From: Matthew Heaney Newsgroups: comp.lang.ada Subject: Re: OO Style with Ada Containers Date: Mon, 26 Nov 2007 03:58:24 +0000 Organization: Posted via Supernews, http://www.supernews.com Message-ID: References: <1195082906.420079.195000@d55g2000hsg.googlegroups.com> <1195084214.480299.13970@t8g2000prg.googlegroups.com> <1195084752.840598.174460@v65g2000hsc.googlegroups.com> <1195086265.070953.93180@d55g2000hsg.googlegroups.com> <1e331441-6abc-4e32-b900-404aa3b10644@g21g2000hsh.googlegroups.com> <8763zqwilm.fsf@ludovic-brenta.org> User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (windows-nt) Cancel-Lock: sha1:1K3/gMjYPJ2GX8qXVaXuneB+jMQ= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@supernews.com X-Original-Bytes: 1753 Xref: g2news1.google.com comp.lang.ada:18616 Date: 2007-11-26T03:58:24+00:00 List-Id: Ludovic Brenta writes: > You can still append to a plain String by creating a > new String: > > declare > New_String : constant Word_Counter > (Length => Old_String.Length + 3, > Word => Old_String.Word & "...", > Count => Old_String.Count); > begin > Map.Replace_Element (Position => ..., > New_Item => New_String); > end; Something here isn't correct, since the Word_Counter subtype would only be used for a set (although perhaps Map in your example has type Set), but also because in the example the key should never change: only the associated count should change (that's what Update_Element_Preserving_Key allows).