On Tue, May 13, 2014 at 6:37 AM, Jonathan S. Shapiro <[email protected]> wrote:
> > Representation: Representation is logically separable from type. Can anybody > give a serious use case where it would be advantageous to specify two > different bit-level representations for a type without changing the type > itself? I am not aware of any. If we can't identify one, then declarations > of representation should continue to be part of the type declaration syntax > for composite types. > > Representation and type are separated in Ada, for example see here (look at > the example at the bottom that gives ranges). Not saying I like the > bit-boundary approach to specification, but it's certainly precise, and it > at least separates the issues. I'm asking for input more about the notion of > separating the layout declaration from the type declaration in this kind of > way. unsure of the seriousness qualification but The only cases i can think of is that a logical ordering of a structure in the sources may not emit an efficient aligning of fields, and one may prefer to keep the logical ordering in the structure declaration, or discover this later and be faced with issues of separate compilation. something which I have not thought about nearly enough to know if it can be done safely is unionizing mutually exclusive fields which have been discovered to be mutually exclusive, for which a bunch of source code currently exists. Though i'm guessing though this probably would be done via the changing the type to some form of anonymous union, so that the old code still compiles rather than changing the repr so that fields overlap, so probably doesn't count. shrug _______________________________________________ bitc-dev mailing list [email protected] http://www.coyotos.org/mailman/listinfo/bitc-dev
