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 X-Received: by 2002:a6b:8d8e:: with SMTP id p136-v6mr2898520iod.32.1527338019651; Sat, 26 May 2018 05:33:39 -0700 (PDT) X-Received: by 2002:a9d:445c:: with SMTP id f28-v6mr626704otj.2.1527338019417; Sat, 26 May 2018 05:33:39 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!feeder.erje.net!2.eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed8.news.xs4all.nl!85.12.16.68.MISMATCH!peer01.ams1!peer.ams1.xlned.com!news.xlned.com!peer01.am4!peer.am4.highwinds-media.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!u74-v6no3181559itb.0!news-out.google.com!b185-v6ni2570itb.0!nntp.google.com!u74-v6no3181556itb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sat, 26 May 2018 05:33:38 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=47.185.233.194; posting-account=zwxLlwoAAAChLBU7oraRzNDnqQYkYbpo NNTP-Posting-Host: 47.185.233.194 References: <574749990.548999719.627915.laguest-archeia.com@nntp.aioe.org> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Multiple iterators for a type From: "Dan'l Miller" Injection-Date: Sat, 26 May 2018 12:33:39 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Received-Bytes: 4178 X-Received-Body-CRC: 1728559502 Xref: reader02.eternal-september.org comp.lang.ada:52693 Date: 2018-05-26T05:33:38-07:00 List-Id: On Saturday, May 26, 2018 at 1:59:59 AM UTC-5, Dmitry A. Kazakov wrote: > On 2018-05-26 05:57, Luke A. Guest wrote: > > Stephen Leake <> wrote: > >=20 > >> 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, b= ut > >> you did not mention that as a requirement. > >> > >=20 > > I=E2=80=99m 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=C3=A8me clusters. >=20 > Why do you bother? I mean, there is no solution for having a=20 > user-defined array type in Ada. Iterator is only a small part of it.=20 > Even if the iterator kludge worked somehow, the rest would not. Conversely, why do you bother writing this reply, raining on his parade? L= uke never said that he wants to change Ada's array itself. He said that he= wants a type implemented via an array that just happens to have 2 or more = other types (i.e., iterators) usable with it. > Multiple inheritance is not complete either, so having two array=20 > interfaces for one object will be extremely difficult and uncomfortable.= =20 > You will end up with a mess of helper generic packages to emulate full=20 > inheritance. [I went that way, there is nothing good there.] Luke never said that he wants an =E2=80=A2array=E2=80=A2 with two personal= ities bolted deeply within the =E2=80=A2array=E2=80=A2 itself. He said tha= t he want 2 or more iterators traversing the one array. He implied that 1 = or more of them would have: 1) a function to return a UCS4/UTF-32 normalized form, when traversing a UT= F-8 sequence of base character plus one or more combining graphemes. 2) a function to return a subarray of denormalized UTF-8 base character plu= s one or more combining characters, when traversing a fully- or partially-n= ormalized character in the main array. > In short, there is nothing useful Ada 20xx could bring to the problem of= =20 > dealing with encoded strings. We will see if your prediction of the outcome of this thread proves to be t= rue. If at least one multiple-iterator solution arrises for traversing one= single-personalty** array, then your theorem would be proven false by coun= terexample. ** The single personality of that main array that Luke implies is: the mai= n array can have any valid UTF-8 characters in it, including any variant of= fully-normalized, partially-normalized, and fully-denormalized characters = regarding the combining-form graphemes (e.g., for diacritics when focusing = on the Latin language-family alphabets).