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.4 required=5.0 tests=BAYES_00,FORGED_MUA_MOZILLA autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,b4a4dceda94869d2 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.25.194 with SMTP id e2mr287933pbg.7.1320757993463; Tue, 08 Nov 2011 05:13:13 -0800 (PST) Path: h5ni12601pba.0!nntp.google.com!news1.google.com!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!nntp.club.cc.cmu.edu!feeder.erje.net!news.musoftware.de!wum.musoftware.de!news.weisnix.org!newsfeed.ision.net!newsfeed2.easynews.net!ision!newsfeed.arcor.de!newsspool3.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Tue, 08 Nov 2011 14:13:03 +0100 From: Georg Bauhaus User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Iterators in Ada2012 References: <66dbca36-0248-458a-aff4-1176d6ce098b@m10g2000vbc.googlegroups.com> In-Reply-To: <66dbca36-0248-458a-aff4-1176d6ce098b@m10g2000vbc.googlegroups.com> Message-ID: <4eb92ae0$0$6581$9b4e6d93@newsspool3.arcor-online.net> Organization: Arcor NNTP-Posting-Date: 08 Nov 2011 14:13:04 CET NNTP-Posting-Host: c954e04c.newsspool3.arcor-online.net X-Trace: DXC=4[S8;]iZab485[]]\]T081McF=Q^Z^V384Fo<]lROoR18kF:Lh>_cHTX3j=XeT;gVZi8n? X-Complaints-To: usenet-abuse@arcor.de Xref: news1.google.com comp.lang.ada:18860 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Date: 2011-11-08T14:13:04+01:00 List-Id: On 08.11.11 11:05, comp.lang.php wrote: > I have an instantiation of the package Ada.Containers.Ordered_Maps > (Integer, Float). Is there a neat way of iterating over the values > similar to the construction: > for x of a_Set loop ... end loop. Fear of nesting a procedure? :-) I had thought that the new syntax of AI 139 would be for all containers. Strangely, the fashion seems to be moving elsewhere: list comprehensions, Map + Reduce (US Patent #7,650,331), Scala, ... all functional, hence little sympathy for for-loops. Sequence comprehensions are now recommended when writing Python, so I had thought there is all the more to say in favor of a simple automatic Container.Iterate (Process => Meaningful_Name'Access). But OTOH, Guido van Rossum suggested to simply write a for-loop in place of a traditional reduce procedure. With Ada, the two can be combined...