You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
These existence of these features here wouldn't actually help much for converting between json or toml and crimson ordered/order preserving types depending upon whether this flag is enabled.
But I think the problems associated with these features, and even their mere existence at least provides some motivation
for having an ordered preserving tree.
Argument against
It is kind of weird, and no other serialization languages I know of include any kind of order preserving tree.
Of those languages that don't include it, I know of zero complaints regarding it, If you need order preserving you probably just use an order preserving parser if not you don't.
This would make crimson -> json a non-injective surjective function where Tree and Map both correspond to json's Object,
however I believe that is already the case regarding Set.
The text was updated successfully, but these errors were encountered:
Background
Crimson has a dichotomy between ordered and unordered collections,
{0, 1, 2}
[0, 1, 2]
{"foo" = 1, "bar" = 2}
For syntactic consistency it somewhat makes sense to include
["foo" = 1, "bar" = 2]
This rule is commented out of the grammar here:
crimson/src/crimson.y
Lines 60 to 69 in a0472b0
Argument for
I think that the biggest argument for allowing it comes from the
order_preserving
feature of the following libraries:https://docs.rs/crate/toml/latest/features
https://docs.rs/crate/serde_json/latest/features
These existence of these features here wouldn't actually help much for converting between json or toml and crimson ordered/order preserving types depending upon whether this flag is enabled.
But I think the problems associated with these features, and even their mere existence at least provides some motivation
for having an ordered preserving tree.
Argument against
It is kind of weird, and no other serialization languages I know of include any kind of order preserving tree.
Of those languages that don't include it, I know of zero complaints regarding it, If you need order preserving you probably just use an order preserving parser if not you don't.
This would make crimson -> json a non-injective surjective function where
Tree
andMap
both correspond to json'sObject
,however I believe that is already the case regarding
Set
.The text was updated successfully, but these errors were encountered: