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!news.albasani.net!newsfeed.xs3.de!io.xs3.de!news.jacob-sparre.dk!franka.jacob-sparre.dk!pnx.dk!.POSTED.rrsoftware.com!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Record operations (Algebraic Data Types and printing) Date: Fri, 12 Oct 2018 14:16:28 -0500 Organization: JSA Research & Innovation 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> Injection-Date: Fri, 12 Oct 2018 19:16:28 -0000 (UTC) Injection-Info: franka.jacob-sparre.dk; posting-host="rrsoftware.com:24.196.82.226"; logging-data="29065"; mail-complaints-to="news@jacob-sparre.dk" X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Response X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.7246 Xref: reader02.eternal-september.org comp.lang.ada:54555 Date: 2018-10-12T14:16:28-05:00 List-Id: "Dmitry A. Kazakov" wrote in message news:ppphli$l29$1@gioia.aioe.org... > On 2018-10-11 23:35, Randy Brukardt wrote: >> "Dmitry A. Kazakov" wrote in message >> news:ppk92s$4ht$1@gioia.aioe.org... >>> On 2018-10-10 00:20, Randy Brukardt wrote: >>>> "Lucretia" wrote in message >>>> news:fb2af9cb-5317-4f1c-867c-8876212d303b@googlegroups.com... >>>> 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? >> >> Sorry about the sloppy language, I was referring to the default Image >> string >> representation for a type. >> >> The proposal for 'Image defines such a representation for all types (for >> a >> task, it is the task id and discriminants, for instance). It's not clear >> how >> to define 'Value usefully for such a representation (most likely it would >> not be). >> >> In any case, it is a non-trivial problem, substantially harder than the >> matching problem for 'Image. > > Another difficult problem is to define rules how 'Image and 'Value of a > composite type should use or not use 'Image and 'Value of the components > and ancestors. Say Image of a component gets overridden. Does it have > effect and when? Does it change the behavior later on or only newly > compiled modules, only those where overriding is visible, directly? etc. > I.e. is any call to Image is always "dispatching"? Hardly difficult; it has to work like streaming and thus it always applies. Perhaps you ought to take a look at AI12-0020-1. We eventually concluded that directly overriding 'Image was never going to work (for reasons like those you give above). So 'Image is now defined to be constructed out of a new stream-like attribute Put_Image. Like the stream attributes, the default implementation of these compose (for components, parent parts, etc.). (And for scalar types, it's defined to produce the results as expected for current Ada.) We already have the needed rules for doing that, so it's relatively easy. Presumably, 'Value will define a similar attribute Get_Image. The problem (as noted) is deciding what it should do by default for various limited and private types. Randy.