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!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Multiple iterators for a type Date: Sat, 26 May 2018 08:59:55 +0200 Organization: Aioe.org NNTP Server Message-ID: References: <574749990.548999719.627915.laguest-archeia.com@nntp.aioe.org> NNTP-Posting-Host: CvkHMVp693S8Z+lk11jyqg.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 X-Notice: Filtered by postfilter v. 0.8.3 Content-Language: en-US Xref: reader01.eternal-september.org comp.lang.ada:54835 Date: 2018-05-26T08:59:55+02:00 List-Id: On 2018-05-26 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. Why do you bother? I mean, there is no solution for having a user-defined array type in Ada. Iterator is only a small part of it. Even if the iterator kludge worked somehow, the rest would not. Multiple inheritance is not complete either, so having two array interfaces for one object will be extremely difficult and uncomfortable. You will end up with a mess of helper generic packages to emulate full inheritance. [I went that way, there is nothing good there.] In short, there is nothing useful Ada 20xx could bring to the problem of dealing with encoded strings. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de