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: Wed, 4 Jul 2018 09:37:41 +0200 Organization: Aioe.org NNTP Server Message-ID: References: <70c11a71-3832-4f57-8127-f3f1c48a052f@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> <9524b7ed-b3c4-4775-9e62-7455bf1633c1@googlegroups.com> <7180e44d-6e11-4df3-ae01-96829298c03c@googlegroups.com> NNTP-Posting-Host: MyFhHs417jM9AgzRpXn7yg.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 Content-Language: en-US X-Notice: Filtered by postfilter v. 0.8.3 Xref: reader02.eternal-september.org comp.lang.ada:53562 Date: 2018-07-04T09:37:41+02:00 List-Id: On 2018-07-04 03:59, Lucretia wrote: > I've just read it. Yeah, I agree that Ada should be able to extend records with data, not functions/procedures, but I don't see how the lack of that is a hindrance to creating a decent unicode lib. The fact that he refuses to answer such a simple question, i.e "WTF are you on about?" explains a lot. I never refuse answering. Let me state the requirements of a sane implementation: 1. All types related. You can pass String where UTF8_String is expected and conversely keeping the *semantics*. That means that when one string contains a-umlaut it stays a-umlaut in another string. 2. All strings are arrays of Unicode points. You can iterate characters even in an UTF-8 string or a DEC RADIX-50 string. 3. All strings are arrays of the corresponding representation units. You can iterate representation units. 4. All string representations stripped of the the bounds have machine representations in the stated encoding. You can pass a flat UTF-8 string down to a C library with no fuss. 5. For any string operation one can provide either a type-specific implementation or inherit a body from another strings type (see #1). You can write a specific Put_Line for Latin-1 string or use (inherit) Put_Line for UTF-8 string. -------------- The point is that this is impossible in Ada. If you think otherwise, you are welcome to outline a way. What fixes required to be able to implement it is a subject of serious discussion about the Ada type system, which nobody seemingly is interested in, at the time. Though I am ready when you are. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de