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: Strange crash on custom iterator Date: Tue, 3 Jul 2018 22:18:24 +0200 Organization: Aioe.org NNTP Server Message-ID: 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> NNTP-Posting-Host: 3CrKQyqWAJZHy6zYVP/kUg.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit 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: reader02.eternal-september.org comp.lang.ada:53548 Date: 2018-07-03T22:18:24+02:00 List-Id: On 2018-07-03 18:42, Lucretia wrote: > On Tuesday, 3 July 2018 17:36:12 UTC+1, Dmitry A. Kazakov wrote: > >> Without having types related, we get a geometric explosion of packages: >> character type x encoding method x fixed/bounded/unbounded. Clearly >> nobody would ever add UTF-8 into this mess, because this will double the >> number of packages where strings are used. Static polymorphism >> (generics/overloading) does not work here. > > Well, they kind of already did that by subtyping UTF_String from String, of which it's not a subtype, it's just they are both arrays of 8-bit entities. No. Both are arrays of code points and arrays of octets. The ranges of code points are different. The correspondence between code points and octets are different. Thus the subtyping is broken. > Am i wrong, should I just implement what I need on top of the standard lib and just use the UTF* types in my code? What about unbounded_utf_strings? Just use the normal unbounded_string? It's not like it's going to be checking for it to be correct utf8 is it, but I can't write an iterator for that from outside the rts though. There is no way to do it right in Ada for now. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de