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:a24:fa85:: with SMTP id v127-v6mr2933642ith.11.1527344555996; Sat, 26 May 2018 07:22:35 -0700 (PDT) X-Received: by 2002:a9d:5543:: with SMTP id h3-v6mr617506oti.13.1527344555811; Sat, 26 May 2018 07:22:35 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!feeder3.usenet.farm!feed.usenet.farm!newsfeed.xs4all.nl!newsfeed8.news.xs4all.nl!85.12.16.70.MISMATCH!peer03.ams1!peer.ams1.xlned.com!news.xlned.com!peer03.am4!peer.am4.highwinds-media.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!u74-v6no3264609itb.0!news-out.google.com!b185-v6ni2662itb.0!nntp.google.com!u74-v6no3264607itb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sat, 26 May 2018 07:22:35 -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 14:22:35 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Received-Bytes: 4428 X-Received-Body-CRC: 2736689983 Xref: reader02.eternal-september.org comp.lang.ada:52698 Date: 2018-05-26T07:22:35-07:00 List-Id: On Saturday, May 26, 2018 at 8:52:18 AM UTC-5, Dmitry A. Kazakov wrote: > On 2018-05-26 15:03, Lucretia wrote: > > On Saturday, 26 May 2018 07:59:59 UTC+1, Dmitry A. Kazakov wrote: > >> 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 ou= t, > >>>> there can be only one that gets special treatment from the compiler,= but > >>>> you did not mention that as a requirement. > >>>> > >>> > >>> 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 octet= s and > >>> generate code points, then another will be graph=C3=A8me 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 uncomfortabl= e. > >> 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. > >=20 > > Sorry, didn't understand a word of this wrt to my post. > >=20 > > We can't have user defined array types in Ada? WTF? >=20 > There are only built-in arrays in Ada. You cannot have an array ADT=20 > providing your array object representation and/or implementation of=20 > array operations. >=20 > > What wouldn't work? >=20 > Implementation of encoded string with two array views of it, as an array= =20 > of encoding units and an array of characters/glyphs/code points etc. >=20 > > How is MI involved here? >=20 > An encoded string implements two array interfaces. Other than from Dmitry, where did =E2=80=9Cencoded string=E2=80=9D come fro= m in this thread? Dmitry, where are you getting this (bizarre) definition = of =E2=80=9Cencoded string=E2=80=9D? From some non-Ada programming languag= e? And apparently not a mainstream one, at that. [I ask because a quick Bing/Google search turns up only the canonical defin= ition of encoded string: a 2nd string converted to a special encoding (e.g= ., Base64 in MIME) as the (separate) =E2=80=A2output=E2=80=A2 (encoded-)str= ing of a (encoding-)transformation that took a (separate) (unencoded-)input= string that lacked the special encoding. I couldn't easily find any progr= amming language or library that uses =E2=80=9Cencoded string=E2=80=9D as it= s internal-culture jargon that has your apparently-novel definition of 2 co= ncurrent/super-imposed array-esque personalities on the same string-instanc= e.]