Hi,
as the discussion just came up on Slack ... taking it where it belongs ... on
the list ;.)
So the problem was, that it's difficult to have anything optional that is not a
"simple" field.
My Idea would be to change the way "optional" is used and to convert it into a
wrapper element. It would just contain an expression and contain normal fields
inside.
So an
[optional uint 8 "hurz" "some expression"]
Would bebome:
[optional "some expression"
[simple uint 8 "hurz"]
]
This way we could even wrap multiple elements inside the optional condition and
all of our types.
In general it would simply map to an if expression.
I doubt the changes would be very significant. We would need to add an
"optional" flag to the internal field types and set that to false in the
general case but to true inside an optional field.
Chris