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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: Victor Porton Newsgroups: comp.lang.ada Subject: Re: Some problems with iterators Date: Thu, 21 Aug 2014 19:34:28 +0300 Organization: Aioe.org NNTP Server Message-ID: References: NNTP-Posting-Host: AnnUDmZwVERVUXyHDyOl5A.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7Bit X-Complaints-To: abuse@aioe.org User-Agent: KNode/4.13.3 X-Notice: Filtered by postfilter v. 0.8.2 Xref: news.eternal-september.org comp.lang.ada:21860 Date: 2014-08-21T19:34:28+03:00 List-Id: Egil H H wrote: > On Wednesday, August 20, 2014 6:48:53 PM UTC+2, Victor Porton wrote: >> Why Ada2012 does allow only type name for an iterator in for loops, > > Please provide an example, or better yet, an RM reference, I can't find > any for-loop that takes a type name for an iterator. > >> not an iterator object? > > But we can, RM 5.5.2(2/3). It seems my misreading of RM: "For the first form of iterator_specification, called a generalized iterator, the expected type for the iterator_name is any iterator type." I understood this as need to supply an iterator type as iterator_name, not a value of this type. It seems my misunderstanding. >> The following does not verify with GCC 4.9.1 (I think it is a compiler >> bug and have reported this bug in GCC Bugzilla): > > What error do you get? https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62205 test.ads:19:28: Default Iterator must be a primitive of "Descriptions_List" Also, it seems that GCC 4.9.1 does not support "for ... in ... loop" syntax. -- Victor Porton - http://portonvictor.org