RecordFlux
RecordFlux copied to clipboard
Calculate value of a type
Sometimes the value of a type cannot be derived from scalar values or basic operations on scalar values, but are more complex calculation is required. Examples are variable length integers (#8) or the sum of the length fields of certain elements of an array (#215).
Create a concept for types to have values. Idea: Add a Value
attribute to a type with an expression stating how to calculate the resulting value. The value can then be used in a specification through a 'Value
attribute applied to the respective field.
Questions:
- What's the result type of the
Value
attribute - Are there situations where we need multiple values for one type?
- How can a verifiable parser be derived from that?
- Do we need to restrict the allowable expressions to guarantee a verifiable parser?