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: Record operations (Algebraic Data Types and printing) Date: Wed, 10 Oct 2018 20:36:29 +0200 Organization: Aioe.org NNTP Server Message-ID: References: <0f5608ef-0038-491c-b15f-f67bcc76fae8@googlegroups.com> <00285ebf-6ede-44da-848f-456930dc7475@googlegroups.com> <3620199a-f025-4099-83ad-a1e5042dc6c0@googlegroups.com> <8903c94f-efc7-4a2c-9513-ee17890b49d2@googlegroups.com> NNTP-Posting-Host: IzvqdhUtDGKIMCldyDtZ+w.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.9.1 Content-Language: en-US X-Notice: Filtered by postfilter v. 0.8.3 Xref: reader02.eternal-september.org comp.lang.ada:54535 Date: 2018-10-10T20:36:29+02:00 List-Id: On 2018-10-10 20:13, G. B. wrote: > Dmitry A. Kazakov wrote: >> On 2018-10-10 00:20, Randy Brukardt wrote: > >>> What package? We're talking about (in part) the default representation for a >>> type. >> >> What have T'Image and T'Value to do with the type representation? > > I suppose that if “for a type” here is to mean given type T one may apply > T’Image to an object (directly), then the result represents an object of > type T. Not in the sense of representation clauses, but in the sense of > printed value. It does not. It represents an object of the type String. The value of the string may correspond to an object of the type T or can be used to create an object of the type T. Corresponds /= represents. Represents means substitutable. Image/Value could represent T if String were a sub-/supertype of T. This is not possible in Ada. The litmus test is inheritance of the interface of T. If you could write something like this 1'Image + 2 = "3" You could say that 1'Image represents Integer'(1). And "3" represents Integer'(3). -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de