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 09:17:49 +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: 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.9.1 X-Notice: Filtered by postfilter v. 0.8.3 Content-Language: en-US Xref: reader02.eternal-september.org comp.lang.ada:54531 Date: 2018-10-10T09:17:49+02:00 List-Id: On 2018-10-10 00:20, Randy Brukardt wrote: > "Lucretia" wrote in message > news:fb2af9cb-5317-4f1c-867c-8876212d303b@googlegroups.com... >> Like what 'Read/'Write/'Input/'Output do, they call a defined subprogram in >> the package. Surely, it's not that hard. > > 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? > Stream attributes use a complex concept called "availability" to deal > with limited types, and they don't worry about privacy breakage at all. Limited types should have no stream attributes at all. Same applied to 'Image/'Value. Returning limited object was a language design bug. This cannot be fixed but it can be contained. > 'Value would need something similar at a minimum, and the question of > privacy breakage also would have to be addressed (a package would not want > some outside force constructing values for its types; they might not meet > the [implied] invariants and other assumptions [...] Safe default is to generate publicly visible 'Image and 'Value propagating Use_Error for all types with private components. The package provider could override them in the public part with bodies renaming the private default implementations of which have full visibility. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de