On Mon, Sep 9, 2013 at 11:08 PM, Bennie Kloosteman <[email protected]>wrote:
> If we are talking an ipheader how can the compiler ensure that length
> field is related to that type ? You would need some sort of special type or
> attribute that binds them together and if wrong field you are in unsafe.
>
With dependent types that's not too bad. You make the relevant length field
initonly, and then declare the inline byte array as something like
byte<payload_len> payload
where payload_len is the length. I don't know of a language that currently
permits this, but it's not complicated.
_______________________________________________
bitc-dev mailing list
[email protected]
http://www.coyotos.org/mailman/listinfo/bitc-dev