The following attributes are defined for struct values.
sizeGives an offset with the storage occupied by the complete struct. Example:
(poke) type Packet = struct { byte s; byte[s] d; }
(poke) (Packet { s = 3 })'size
32UL#b
lengthGives the number of fields stored in the struct. Note that, due to absent fields, this doesn’t always corresponds to the number of fields that appear in the definition of a struct type.
For example, for the following struct type:
type Packet =
struct
{
byte magic: magic in [0xff,0xfe];
byte control if magic == 0xfe;
byte[128] payload;
};
We get the following results:
(poke) (Packet { magic = 0xff })'length
2UL
(poke) (Packet { magic = 0xfe })'length
3UL
mappedBoolean indicating whether the struct is mapped.
strictBoolean indicating whether the struct is mapped in strict mode.