-
-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does argument order w.r.t. properties matter? #205
Comments
I don't see how the relative ordering of arguments to properties can be considered significant. Attempting to make it significant would make the ordering of properties themselves significant. |
Property ordering relative to other properties can still be insignificant, even while argument ordering w.r.t. properties is significant. For the serde use case example, it roughly goes as:
And a slightly different case
In neither of these cases is the property order w.r.t. other properties semantic, as the properties always refer to their named field, and mixing only impacts the meaning of arguments. |
No, argument vs property ordering does not matter. The only thing that matters is argument ordering vs other arguments. Property ordering does not matter except when you deal with duplicates, in which case only the last duplicate wins. No other ordering matters. |
So w.r.t. SiK, the only correct interpretation is that (The rightmost-property-wins rule is interesting for the serde mapping, as the serde-native interpretation is just to pass this duplication along to the (Very side note: would kdl-org (or even this repo) be interested in hosting a SiK spec, once it's reasonably solidified and @Lucretiel is also on board with it?) |
Doesn't the "last duplicate always wins" rule only affect deserialisation anyway? There's nothing stopping you from outputting the duplicates during serialisation. |
Yes; I'm trying to take a holistic design view for SiK even though I've only implemented a serializer so far. Also, serialization almost certainly won't generate duplicates, as that would require a nonstandard |
The spec says that
My question is: if a property is between two arguments, is that allowed to impact the semantics of the arguments in a fully-SHOULD-compliant implementation?
Using the given example,
More informally, does the spec require grouping the above node as roughly
foo (1) (key="val") (3)
, or is an implementation allowed to interpret it asfoo (1) key=("val" 3)
?If argument/property mixing SHOULD NOT matter to implementations, I suggest the following clarification to the spec:
If argument/property mixing MAY matter to implementations, I suggest the following clarification to the spec:
The scope of this question is that I'm drafting out a semi-formal spec for Serde-in-KDL (SiK) a la JiK or XiK, describing how to map between the Serde data model and KDL. Current draft here. I want SiK to feel like natural KDL use as much as possible, and I think I've captured that, save for one current limitation: mixing properties and arguments in a single node isn't supported. In the document I have a potential way to support arguments before properties, but whether this is possible depends on whether this is deserializable within serde's API (unknown, slightly positive), and arguments mixed with properties will need to know the answer to the above spec clarification before I can even consider deciding what the semantics of such should be.
And yes, I am reaching out to collaborate with Lucretiel/kaydle, now that I'm aware of that effort.
The text was updated successfully, but these errors were encountered: