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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: "G.B." Newsgroups: comp.lang.ada Subject: Re: Multiple iterators for a type Date: Sat, 26 May 2018 09:14:57 +0200 Organization: A noiseless patient Spider Message-ID: References: <574749990.548999719.627915.laguest-archeia.com@nntp.aioe.org> Reply-To: nonlegitur@notmyhomepage.de Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Sat, 26 May 2018 07:14:58 -0000 (UTC) Injection-Info: h2725194.stratoserver.net; posting-host="2c0d4d705885ad4e512ad1e6ae7f01a9"; logging-data="11434"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18ktfI9KiLAt8T7330GxEJKbtrbv0SQXoo=" User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 Cancel-Lock: sha1:lvci1PytR80XvIfrzvc6H6b6Gwk= In-Reply-To: <574749990.548999719.627915.laguest-archeia.com@nntp.aioe.org> Content-Language: de-DE Xref: reader01.eternal-september.org comp.lang.ada:54836 Date: 2018-05-26T09:14:57+02:00 List-Id: On 26.05.18 05:57, Luke A. Guest wrote: > Stephen Leake <> wrote: > >> An "iterator" can be anything you want it to be. As Randy pointed out, >> there can be only one that gets special treatment from the compiler, but >> you did not mention that as a requirement. >> > > I’m attempting to implement a Unicode string using UTF-8, so I want the > basic iterator over octets, then the next will iterate over the octets and > generate code points, then another will be graphème clusters. Would layering work where each layer uses Has_Element Next This should then work with streams, too, that is, with open ended arrays read from some source.