Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Compact structs and "byte-stringification"

9 views
Skip to first unread message

Geoffrey Broadwell

unread,
Feb 27, 2007, 9:54:50 AM2/27/07
to p6l
How do you specify that you want to byte-stringify a compact struct,
rather than "normal" stringify it?

Does the byte-stringified version include internal and/or trailing
alignment padding? How do you specify the other choices?

Whether or not trailing padding is included when byte-stringifying a
single compact struct, is the choice the same when byte-stringifying an
array of same? In other words, are you guaranteed that the
byte-stringify of an array of compact structs is merely the
concatenation of the byte-stringification of each struct?


-'f


Larry Wall

unread,
Feb 27, 2007, 7:29:52 PM2/27/07
to p6l
On Tue, Feb 27, 2007 at 06:54:50AM -0800, Geoffrey Broadwell wrote:
: How do you specify that you want to byte-stringify a compact struct,

: rather than "normal" stringify it?

Coerce to a buffer type rather than using ~.

: Does the byte-stringified version include internal and/or trailing


: alignment padding? How do you specify the other choices?

By default it's as like C as possible. Other choices would have to act
something like pack templates and be hung on some appropriate declaration.

: Whether or not trailing padding is included when byte-stringifying a


: single compact struct, is the choice the same when byte-stringifying an
: array of same? In other words, are you guaranteed that the
: byte-stringify of an array of compact structs is merely the
: concatenation of the byte-stringification of each struct?

Yes.

Larry

0 new messages