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!nntp-feed.chiark.greenend.org.uk!ewrotcd!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: Tue, 9 Oct 2018 17:20:48 -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: Tue, 9 Oct 2018 22:20:49 -0000 (UTC) Injection-Info: franka.jacob-sparre.dk; posting-host="rrsoftware.com:24.196.82.226"; logging-data="12923"; 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; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.7246 Xref: reader02.eternal-september.org comp.lang.ada:54529 Date: 2018-10-09T17:20:48-05:00 List-Id: "Lucretia" 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.