Open AODQ opened 2 years ago
I realize now the puleDsObjectMemberAsObject/Array
funcs should use PuleDsValueObject/Array
possible alternative is to pass a string that has the layout ei { width: { type: "u64", }, version: { type: "string", optional: "yes" }}
Description
Typical file workload would currently look like in C
as you can see, it's a bit tedious. We're coupling error handling with parsing. You could write macros to help alleviate this pain, but other languages might not necessarily have the same sort of solution.
Instead it would be useful to have:
It's split up into two separate components. While it'd be nice to have this generate some sort of usable type, it's not really an option in C. With other languages that support introspection, this will help error integration. We can also add
puleDsObjectMemberAs<Type>
functions because they no longer need to be checked if valid.Note we are electing to pick an API with
instead of a single function
puleDsLayoutAdd(PuleDsLayout, char const * const, PuleDsLayoutType, PuleDsLayoutIsOptional)
I'm still not 100% sure if this is the right thing to do; it's less verbose on CpuleDsLayoutAddObject(layout, "crate", PuleDsLayoutType_Object, PuleDsLayoutIsOptional_No); yet with other languages you could have
puleDsLayout(layout, "crate", .Object, .No);`Proposed ABI Changes
Proposed new ABI