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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no 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!postnews.google.com!g21g2000hsh.googlegroups.com!not-for-mail From: braver Newsgroups: comp.lang.ada Subject: Re: OO Style with Ada Containers Date: Fri, 23 Nov 2007 02:28:42 -0800 (PST) Organization: http://groups.google.com Message-ID: <1e331441-6abc-4e32-b900-404aa3b10644@g21g2000hsh.googlegroups.com> 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> NNTP-Posting-Host: 85.30.231.120 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1195813722 27870 127.0.0.1 (23 Nov 2007 10:28:42 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 23 Nov 2007 10:28:42 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: g21g2000hsh.googlegroups.com; posting-host=85.30.231.120; posting-account=V2cESwoAAACnN32CFvmyu4DCs-heiisG User-Agent: G2/1.0 X-HTTP-UserAgent: Opera/9.24 (Macintosh; Intel Mac OS X; U; en),gzip(gfe),gzip(gfe) Content-Disposition: inline Xref: g2news1.google.com comp.lang.ada:18583 Date: 2007-11-23T02:28:42-08:00 List-Id: Matt -- thanks a million for your detailed answers and analysis of Ada Containers usage! This is in fact what's needed the most -- not a just a dry ARM spec, but as examples. Perhaps you and others can post a bunch of code somewhere with the containers usage? That would be most instructive. A few questions about your solution: --STX -- I sense this allows to unroll a blob of Ada compilation units into one unit per file, which tool reads this and does it? What's the tradeoff between your solution, using package Map_Types is new Indefinite_Hashed_Maps (String, Natural, Hash_Case_Insensitive, Equal_Case_Insensitive); -- and Ludivoc Brenta's, using Hashed_Sets of your modified discriminated type Word_Counter (Length : Positive) is record Word : String (1 .. Length); Count : Natural; end record; In general, if I use lots of strings -- and my application area os computational linguistics -- should I try to use plain String(1..N), trying all kinds of tricks to constrain it as above, or Ada.Strings.Unbounded are OK, too? I've tried to leverage plain String, thinking that it being unconstrained array can allow for behavior similar to dynamic strings in Python, etc. Alas, I cannot append to it doing S := S & Tail;... OTOH, I can't index Unbounded string with US(i), -- or can I? -- and it doesn't look pretty to use Element everywhere... And if Element, can that be well used with prefix notation? Cheers, Alexy