comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Record operations (Algebraic Data Types and printing)
Date: Fri, 12 Oct 2018 14:16:28 -0500
Date: 2018-10-12T14:16:28-05:00	[thread overview]
Message-ID: <ppqruc$sc9$1@franka.jacob-sparre.dk> (raw)
In-Reply-To: ppphli$l29$1@gioia.aioe.org

"Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in message 
news:ppphli$l29$1@gioia.aioe.org...
> On 2018-10-11 23:35, Randy Brukardt wrote:
>> "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in message
>> news:ppk92s$4ht$1@gioia.aioe.org...
>>> On 2018-10-10 00:20, Randy Brukardt wrote:
>>>> "Lucretia" <laguest9000@googlemail.com> 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.





  reply	other threads:[~2018-10-12 19:16 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-05 17:46 Record operations (Algebraic Data Types and printing) Henrik Härkönen
2018-10-05 17:58 ` AdaMagica
2018-10-05 18:11   ` Henrik Härkönen
2018-10-05 18:46     ` Niklas Holsti
2018-10-05 20:33       ` Henrik Härkönen
2018-10-06  5:38   ` J-P. Rosen
2018-10-06  7:08     ` Henrik Härkönen
2018-10-06 16:42       ` Lucretia
2018-10-08 23:08         ` Randy Brukardt
2018-10-09  1:12           ` Lucretia
2018-10-09 22:20             ` Randy Brukardt
2018-10-10  7:17               ` Dmitry A. Kazakov
2018-10-10 18:13                 ` G. B.
2018-10-10 18:36                   ` Dmitry A. Kazakov
2018-10-11 11:29                   ` Björn Lundin
2018-10-11 14:45                     ` Jacob Sparre Andersen
2018-10-11 18:34                       ` Björn Lundin
2018-10-12 19:08                     ` G. B.
2018-10-12 19:20                       ` Randy Brukardt
2018-10-11 21:32                   ` Randy Brukardt
2018-10-10 18:38                 ` Shark8
2018-10-11  8:36                   ` Dmitry A. Kazakov
2018-10-11 21:35                 ` Randy Brukardt
2018-10-12  7:14                   ` Dmitry A. Kazakov
2018-10-12 19:16                     ` Randy Brukardt [this message]
2018-10-06 16:18     ` Jeffrey R. Carter
2018-10-06 17:19       ` Dmitry A. Kazakov
2018-10-08 23:03   ` Randy Brukardt
2018-10-09  6:22     ` Henrik Härkönen
2018-10-09  7:32       ` Paul Rubin
2018-10-09  7:38         ` Henrik Härkönen
2018-10-09 22:25         ` Randy Brukardt
2018-10-05 18:32 ` Niklas Holsti
2018-10-05 18:43   ` Henrik Härkönen
2018-10-05 19:41   ` Simon Wright
2018-10-06  6:17     ` Henrik Härkönen
2018-10-06 16:04       ` Stephen Leake
2018-10-06 16:56         ` Simon Wright
2018-10-08  6:44           ` briot.emmanuel
2018-10-08 14:09             ` Simon Wright
2018-10-08 14:21               ` Bill Findlay
2018-10-08 14:42                 ` Simon Wright
2018-10-08 16:46                   ` Bill Findlay
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox