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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: A few questions Date: Tue, 03 Nov 2015 08:34:09 +0000 Organization: A noiseless patient Spider Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="2d7699570724a9a82a760842267e2c56"; logging-data="2162"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/R7EeD9Jumoa+OdneH72iC/zCEGE9iGvk=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (darwin) Cancel-Lock: sha1:su0I+4rL3hmrLPocWmI5nCnishc= sha1:pWa8FYM8LmESr8ZEQ+P3hgaYhIE= Xref: news.eternal-september.org comp.lang.ada:28193 Date: 2015-11-03T08:34:09+00:00 List-Id: "Randy Brukardt" writes: > "Simon Wright" wrote in message > news:ly611kmh1g.fsf@pushface.org... > ... >> I wrote the attached, using generalized iteration, which bears a >> strong resemblance to the standard container iteration (the names >> bear too strong a resemblance! but this way you can see the >> commonality). > > I suspect you could have written this in a lot simpler > fashion. Something similar to the Prime_Numbers iterator found in the > ACATS foundation (F552A00, look in the support subdirectory, > specifically > http://www.ada-auth.org/cgi-bin/cvsweb.cgi/acats/support/f552a00.a) > would be a starting point. (Thanks again to Brad Moore for creating > this foundation and the associated ACATS tests to give all Ada > implementers something to use as a correct example of iterators.) Great pointer. Though I think the Date case would be a bit more complicated, because you couldn't constrain a Date_Set by Times or Durations.