yeslogic/fathom

Parameterised struct formats

brendanzab opened this issue · 0 comments

It would be nice to have parameters on struct formats. For example:

struct MyTable (SubTable : Format) : Format {
    count : U32Be,
    sub_tables : FormatArray count SubTable,
}

The parameters should form a telescope, allowing for dependencies between parameters:

struct Data (len : Int) (Data : FormatArray len U8) : Format {
    data : Data,
}