<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>22761</bug_id>
          
          <creation_ts>2013-07-22 22:58:28 +0000</creation_ts>
          <short_desc>Maps, esp. map creation is not part of streamability analysis</short_desc>
          <delta_ts>2014-05-15 14:00:42 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>XPath / XQuery / XSLT</product>
          <component>XSLT 3.0</component>
          <version>Member-only Editors Drafts</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>major</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Abel Braaksma">abel.braaksma</reporter>
          <assigned_to name="Michael Kay">mike</assigned_to>
          
          
          <qa_contact name="Mailing list for public feedback on specs from XSL and XML Query WGs">public-qt-comments</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>91101</commentid>
    <comment_count>0</comment_count>
    <who name="Abel Braaksma">abel.braaksma</who>
    <bug_when>2013-07-22 22:58:28 +0000</bug_when>
    <thetext>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&apos;s key/value pair.

Note: this rule assumes an implicit fork for each map-item in the expression, which allows expressions like { &quot;price&quot; : price, &quot;quantity&quot; : 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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>91969</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2013-08-13 08:30:10 +0000</bug_when>
    <thetext>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&apos;m inclined towards (a).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>93642</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2013-09-23 13:46:48 +0000</bug_when>
    <thetext>The WG (F2F in New York) agreed the general principle that map constructors should do an &quot;implicit fork&quot;, 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.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>