comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Record operations (Algebraic Data Types and printing)
Date: Tue, 9 Oct 2018 17:20:48 -0500
Date: 2018-10-09T17:20:48-05:00	[thread overview]
Message-ID: <ppj9k1$cjr$1@franka.jacob-sparre.dk> (raw)
In-Reply-To: fb2af9cb-5317-4f1c-867c-8876212d303b@googlegroups.com

"Lucretia" <laguest9000@googlemail.com> wrote in message 
news:fb2af9cb-5317-4f1c-867c-8876212d303b@googlegroups.com...
On Tuesday, 9 October 2018 00:08:05 UTC+1, Randy Brukardt  wrote:
...
>> >This is something that should've been in the language from the start or 
>> >at
>> >least 95, this can be used for converting data, in a standard way, to 
>> >XML,
>> > JSON, YAML or TOML, etc.
>>
>> There's no 'Value proposed at this time. That is a much bigger problem 
>> for
>> limited and private types (how does one get the value of a task or 
>> protected
>> object?), it's messier for user-defined 'Image, etc. It's on the radar, 
>> but
>> not likely for Ada 2020.
>
>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. Stream attributes use a complex concept called "availability" to deal 
with limited types, and they don't worry about privacy breakage at all. 
'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 - remember, there would be no 
way to control what input was given to such an operator -- it would 
definitely be a new form of vunrability.). Contrast that to 'Image, which is 
defined for all types; they do in fact break privacy, but only for a reader; 
for a human reader, they can do the same privacy breakage by inspecting the 
source code. (And if inspecting the source code isn't allowed, the 
implementation can always use a user-defined Put_Image to eliminate any 
leakage.)

It's certainly not impossible (which is why it's considered for the future), 
but it's significantly harder than 'Image. The group as a whole seemed to 
think that if 'Image was tied to 'Value, it wasn't important enough for the 
substantial work. (I personally am closer to your position, but no one gets 
everything they want in Ada. And it would be a tough call as to what else to 
drop - this is a zero-sum game, there is only so much work time available.)

                                                   Randy.



  reply	other threads:[~2018-10-09 22:20 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 [this message]
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
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