-
Notifications
You must be signed in to change notification settings - Fork 22
Extend FLWOR expressions to maps #31
Copy link
Copy link
Closed
Labels
CompletedPR has been applied, tests written and tagged, no further action neededPR has been applied, tests written and tagged, no further action neededFeatureA change that introduces a new featureA change that introduces a new featureXPathAn issue related to XPathAn issue related to XPathXQueryAn issue related to XQueryAn issue related to XQuery
Metadata
Metadata
Assignees
Labels
CompletedPR has been applied, tests written and tagged, no further action neededPR has been applied, tests written and tagged, no further action neededFeatureA change that introduces a new featureA change that introduces a new featureXPathAn issue related to XPathAn issue related to XPathXQueryAn issue related to XQueryAn issue related to XQuery
Edit: Current proposal (#31 (comment)):
With the addition of the
for membersyntax for arrays, it is possible to use a ForExpr/FLWORExpr to enumerate the contents of sequences and arrays, but not maps. In order to be consistent and symmetric across these types, thefor membersyntax should be extended to support maps by enumerating the key/value entries of the map.Given a map of type
map(K, V)the member RecordTest would berecord(key as K, value as V). Given a map of typemap(*), the member RecordTest would berecord(key, value).This would allow a user to write expressions like:
NOTE: With the addition of the
array:valuesandmap:entriesfunctions in issue #29, it is possible to avoid the need of thefor membersyntax for arrays and maps, but may be worth keeping for people who prefer the wordy style of the XPath/XQuery syntax.