Draft Object Serialization Specification for records - construction/destruction
chris.hegarty at oracle.com
Mon Oct 7 15:37:49 UTC 2019
> On 7 Oct 2019, at 15:31, Peter Levart <peter.levart at gmail.com> wrote:
> Yeah, but now the spec explicitly spells out that: "The serialized form of a record object is a sequence of values derived from the final instance fields of the object.", which is wrong. Imagine a custom accessor doing some normalization instead of canonical constructor, because record author wants to preserve information for internal logic. In the future, deconstructors/extractors would probably have to specify that they must be aligned with accessors. Perhaps the spec should speak about "component values" and then specify that currently the only way to obtain them is via accessors.
Ok, I see your point now. I’m really not sure how much customization accessors can or should do, but I do see your reasoning.
Let me ponder this a little, and I’ll reply here shortly.
More information about the amber-spec-experts