[foreign] RFR 8218153: Read/Write of Value layout should honor declared endianness

John Rose john.r.rose at oracle.com
Wed Feb 27 03:31:01 UTC 2019


On Feb 26, 2019, at 4:07 PM, Maurizio Cimadamore <maurizio.cimadamore at oracle.com> wrote:
> 
> At which point, localize(Layout) can be simply expressed as Layout::withEndianness(Endianness.hostEndian())
> 
> I'd suggest that withEndianness should alter endianness of existing layouts which do *not* have endianness, but should throw when changing endianness of something that already has an endianness of a different polarity.

I think nop rather than throw is more useful.
The effect is "as if" the original layout had a
prefix of > or <, but any locally embedded
> or < are left undisturbed.  Surely that's useful?

The use case of reversing a previous set layout
suggested by Henry can be covered by reassembling
the layout from scratch.  And the use case of detecting
that there is some subpart that already has > or <
can be covered by traversing from scratch. Both of
those use cases seem less interesting to me than
composing a perfectly nice layout with a prepended
> or <.

— John



More information about the panama-dev mailing list