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: Fri, 6 Jul 2018 10:57:21 +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> NNTP-Posting-Host: MyFhHs417jM9AgzRpXn7yg.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit 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:53690 Date: 2018-07-06T10:57:21+02:00 List-Id: On 2018-07-06 10:28, G.B. wrote: > On 05.07.18 09:55, Dmitry A. Kazakov wrote: > >>>>>>>> Back to the square >>>>>>>> one, how to design an UTF-8 string type? >>>>>>> >>>>>>> Never. >>>>>>> >>>>>>> What is the proper representation of 3? >>>>>> >>>>>> What is 3 here? >>>>> >>>>> It names a value of some type. >>>> >>>> Which type? You name the type, >>> >>> Any type whose objects' values include the value 3 >>> and which does not specify a representation in source, >>> like Standard.Integer. >> >>  The representation of a class-wide object is (Tag, Value). > > Obviously, 3 is not, given integers in Ada. Of course it is. The representation of Integer 3 is the representation of Integer 3 and is not the representation of Integer'Class 3. > Also, your use of > "representation" seems to exclude Ada representation of > the Value part the pair introduced above. How's that? Not at all. If Integer'Class existed then representation of X : Integer'Class := 3: would be exactly Integer'Tag Integer'(3) whereas the representation of Y : Integer := 3: is, as always: Integer'(3) Types Integer'Class and Integer are different and have different representations. Each type has a representation of its own, no? >> So, name the specific type and you get the representation. > > What is the representation declared by Standard.Integer? It is not declared, it is implied, usually the machine representation of signed integer of the machine word length. >> There is no values and representations of without types. > > A red herring. But true, regardless. Questions like what is the representation of 3 are meaningless. The answer is "any". >>>>> I’d not want encoding here. >>>> >>>> There is always some. >>> >>> Not in source, where design is fixed explicitly. > > Anything on this one? If you formulate the question so that I could understand it then ... >>>>  But I still have no idea what you want to say by that. >>> >>> A properly typed procedure object handles the use case of >>> encoding I/O in a type safe way. The type is not that of >>> string-with-something composites. It is the type which covers >>> the use case procedurally. >> >> I do not quite understand this either, but it sounds more right than >> wrong. So? > > So stop considering type for just data objects, consider types for > operation objects instead and then need to perpetually entangle > string objects with encoding objects is gone. Where I consider type as data objects and how is that relevant? -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de