This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 22761 - Maps, esp. map creation is not part of streamability analysis
Summary: Maps, esp. map creation is not part of streamability analysis
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XSLT 3.0 (show other bugs)
Version: Member-only Editors Drafts
Hardware: All All
: P2 major
Target Milestone: ---
Assignee: Michael Kay
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-07-22 22:58 UTC by Abel Braaksma
Modified: 2014-05-15 14:00 UTC (History)
0 users

See Also:


Attachments

Description Abel Braaksma 2013-07-22 22:58:28 UTC
Streamability of map constructors has been a topic in the WG mailing list [1], [2], however, it never made it to the streamability analysis.

As a refresher, Michael Kay suggested in the aforementioned mail to allow multiple downward expressions in map constructors, by considering them in an implicit fork. Essentially, if we are to follow that line of thought, we get something like this:

----
MapExpr [112]

Determine the sweep for each key/value pair, any of the following:
- Key is consuming, value is motionless, then consuming
- Key is motionless, value is consuming, then consuming
- Otherwise, free ranging

The sweep of a map expression is the maximum sweep of each item's key/value pair.

Note: this rule assumes an implicit fork for each map-item in the expression, which allows expressions like { "price" : price, "quantity" : quantity }.

----

We might attempt something similar for map:new, but not sure we should.


[1] https://lists.w3.org/Archives/Member/w3c-xsl-wg/2012Aug/0000.html
[2] https://lists.w3.org/Archives/Member/w3c-xsl-wg/2012Aug/0002.html
Comment 1 Michael Kay 2013-08-13 08:30:10 UTC
Should we retain the rule that if there are duplicate keys, the last one wins? When the key/value pairs are evaluated in parallel, this rule is more difficult to implement.

Alternative rules:

(a) duplicate keys are a dynamic error

(b) if there are duplicate keys it is implementation-dependent which one wins

I'm inclined towards (a).
Comment 2 Michael Kay 2013-09-23 13:46:48 UTC
The WG (F2F in New York) agreed the general principle that map constructors should do an "implicit fork", allowing multiple downward selections.

On the edge case concerning duplicate keys, we (Abel + MK) decided to go with option (a) - duplicate keys are an error.