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!news3.google.com!feeder3.cambrium.nl!feed.tweaknews.nl!not-for-mail From: Ludovic Brenta Newsgroups: comp.lang.ada Subject: Re: OO Style with Ada Containers 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> <87oddv3l55.fsf@ludovic-brenta.org> <4e65cf83-b296-497f-848e-59d543c19a46@v4g2000hsf.googlegroups.com> Date: Thu, 15 Nov 2007 12:35:23 +0100 Message-ID: <87abpf3fno.fsf@ludovic-brenta.org> User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) Cancel-Lock: sha1:l2a0wVGAzCCU2X9M1gJAYOO141c= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Organization: Tele2 X-Trace: DXC=G[b?OZ5_GSdVAEgC<3XI4b6`Y6aWje^Yj1kkKn[4G4;fm@[o=d]MiOmdl braver writes: > Ludovic -- cool! What about the issue with the cursors operations' > full names -- does one really have to enact `use' clauses to > abbreviate them? Cursor types are not tagged, therefore prefixed notation does not work for them. It has to be "Position := [Package_Name.]Next (Position)". But you don't need to do that at all. Also, you seem to imply that abbreviating cursor operations is a design goal of yours. I fail to understand why. My design goals would rather be legibility and maintainability and I very seldom use "use" clauses. > Can we iterate through all elements in a collection with solely > prefix notation? Yes, using Ada.Containers.Hashed_Sets.Iterate. You pass an access to a procedure to Iterate and Iterate calls your procedure once for every element in the container, passing the cursor value. However in the present case, I advise against iterating over any container. My small example uses only Find, Insert, and Replace_Element for each word in the input file; there is no iteration over a container. -- Ludovic Brenta.