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:c105:: with SMTP id e5-v6mr167644itg.13.1530667611294; Tue, 03 Jul 2018 18:26:51 -0700 (PDT) X-Received: by 2002:a54:4e94:: with SMTP id c20-v6mr3795oiy.5.1530667611055; Tue, 03 Jul 2018 18:26:51 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!news.uzoreto.com!weretis.net!feeder6.news.weretis.net!feeder.usenetexpress.com!feeder-in1.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!d7-v6no1195099itj.0!news-out.google.com!z3-v6ni1221iti.0!nntp.google.com!u78-v6no1201930itb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Tue, 3 Jul 2018 18:26:50 -0700 (PDT) In-Reply-To: <1f634e80-a1e7-4fb1-8cdf-5db6a773f36d@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=47.185.195.62; posting-account=zwxLlwoAAAChLBU7oraRzNDnqQYkYbpo NNTP-Posting-Host: 47.185.195.62 References: <70c11a71-3832-4f57-8127-f3f1c48a052f@googlegroups.com> <62e38ee4-f72f-4ed8-bef1-952040fb7f8d@googlegroups.com> <64d8b4a1-a92c-4b90-b95c-e821749de969@googlegroups.com> <887212304.552080112.848502.laguest-archeia.com@nntp.aioe.org> <87muvan83x.fsf@adaheads.home> <1449870001.552246132.581310.laguest-archeia.com@nntp.aioe.org> <1ce9b9c8-b9cb-4ff4-b4c7-fe4827fea15b@googlegroups.com> <1f634e80-a1e7-4fb1-8cdf-5db6a773f36d@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <9524b7ed-b3c4-4775-9e62-7455bf1633c1@googlegroups.com> Subject: Re: Strange crash on custom iterator From: "Dan'l Miller" Injection-Date: Wed, 04 Jul 2018 01:26:51 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: reader02.eternal-september.org comp.lang.ada:53554 Date: 2018-07-03T18:26:50-07:00 List-Id: On Tuesday, July 3, 2018 at 4:04:54 PM UTC-5, Lucretia wrote: > On Tuesday, 3 July 2018 21:18:28 UTC+1, Dmitry A. Kazakov wrote: >=20 > > > Well, they kind of already did that by subtyping UTF_String from Stri= ng, of which it's not a subtype, it's just they are both arrays of 8-bit en= tities. > >=20 > > No. Both are arrays of code points and arrays of octets. The ranges of= =20 > > code points are different. The correspondence between code points and= =20 > > octets are different. Thus the subtyping is broken. >=20 > I know the difference between code points and octets and their arrays. I = was saying that UTF_String is > not a valid subtype of String because String is Latin 1 and UTF_String is= a superset of 7-bit ASCII, not > 8-bit Latin 1. Well, there are 2 ways of looking at UTF-8: before versus after parsing. is not a superset: One is whether each 8-bit value in Latin-1 has the same value in the UTF-8 = octet-by-octet representation =E2=80=A2prior=E2=80=A2 to parsing. Using th= is analysis, all of the upper 128 values have a different meaning than in L= atin-1. is a superset: But the other way of looking at UTF-8 is what character is represented by t= he multi-byte encoding =E2=80=A2after=E2=80=A2 parsing. In this view, the = lowest 256 values of Unicode/ISO10646 conform to Latin-1 (with some quibbli= ng over whether the mark-parity control codes from 16#80 to 16#9F have prec= isely the same meaning versus reserved/unencoded at various editions of var= ious standards). > > > Am i wrong, should I just implement what I need on top of the standar= d lib and just use the UTF* types in my code? What about unbounded_utf_stri= ngs? Just use the normal unbounded_string? It's not like it's going to be c= hecking for it to be correct utf8 is it, but I can't write an iterator for = that from outside the rts though. > >=20 > > There is no way to do it right in Ada for now. >=20 > What do you mean exactly???? He means that it needs his extrapolation-of-Steelman-3-3F idea for compile-= time tagged types that are not tagged records.