kdl-org / kdl

the kdl document language specifications
https://kdl.dev
Other
1.1k stars 61 forks source link

Empty tag is same as no tag. #233

Closed tabatkins closed 2 years ago

tabatkins commented 2 years ago

Don't merge until data model updates (#228) are approved and merged.

djmattyg007 commented 2 years ago

Is this to be considered part of the 2.0 spec? My understanding of the 1.0 spec is that there is absolutely a difference between an empty tag and no tag.

zkat commented 2 years ago

I'm not really into this. I don't want us to start delving into falsiness? I probably missed the conversation about this or forgot about it tho

tabatkins commented 2 years ago

Is this to be considered part of the 2.0 spec? My understanding of the 1.0 spec is that there is absolutely a difference between an empty tag and no tag.

While the tests implied there was a difference (and so my impl currently recognizes one) the spec didn't make a statement one way or the other, just as it didn't about whether an empty child list is distinct from no child list (which we recently discussed in #218 and fixed in the testsuite in #219).

I'm not really into this. I don't want us to start delving into falsiness? I probably missed the conversation about this or forgot about it tho

This is based on the data model proposal from #228. In #225 you seemed to prefer empty tag and no tag being treated the same ("both questions above answered with no").

I don't have much of an opinion either way on this, I just want to make sure the tests reflect what we decide on for the data model.

nichtich commented 2 years ago

My understanding of the 1.0 spec

Specs try to minimize the number of implicit assumptions but cannot fully eliminate them. Same for other kinds of human communication :-)

I think this issue is misleading because it does not specify the level of description:

I think this issue refers to the test cases only. As far as I understand these, the purpose of test cases is only to show that a parser can pretty-print KDL documents. It does not require to parse KDL into a data model instance and to serialize it back in normalized form. Nevertheless the current state is confusing.

How about removing test with tag ("") so implementations can choose whether to keep this information?

zkat commented 2 years ago

ok I thought about it and I think I've settled on "no, I don't want this", so this gets a 👎🏻 from me. I don't want us to null-pun anywhere if we can avoid it.