-
Notifications
You must be signed in to change notification settings - Fork 22
Ordered Maps: maps that retain insertion order #1651
Copy link
Copy link
Closed
Labels
FeatureA change that introduces a new featureA change that introduces a new featurePR PendingA PR has been raised to resolve this issueA PR has been raised to resolve this issueXDMAn issue related to the XPath Data ModelAn issue related to the XPath Data ModelXPathAn issue related to XPathAn issue related to XPathXQFOAn issue related to Functions and OperatorsAn issue related to Functions and Operators
Metadata
Metadata
Assignees
Labels
FeatureA change that introduces a new featureA change that introduces a new featurePR PendingA PR has been raised to resolve this issueA PR has been raised to resolve this issueXDMAn issue related to the XPath Data ModelAn issue related to the XPath Data ModelXPathAn issue related to XPathAn issue related to XPathXQFOAn issue related to Functions and OperatorsAn issue related to Functions and Operators
Currently, XDM maps are “unordered”: An implementation is allowed to organize entries in a way that optimizes lookup, not order. The entries do not have a predictable order unless they are explicitly sorted.
There are cases in which it is helpful if the “insertion order” is preserved – i.e., the order in which new map entries are added to a map. While the insertion order is not relevant if a map is exclusively used for lookups, it may be beneficial if the input includes deliberately sorted key/value pairs, such as (often) in JSON data, configurations or key/value sequences.
I created this issue because there was some confusion in #564, and on Slack, about this map flavor and “sorted maps”, which are discussed in issue #564: Sorted maps hold all map entries sorted by the key, using a comparator or (in its basic variant)
fn:data#1.PR #1609 attempts to solve both requirements at once.