W3C home > Mailing lists > Public > public-qt-comments@w3.org > February 2014

[Bug 24726] New: map:new() and map:merge()

From: <bugzilla@jessica.w3.org>
Date: Wed, 19 Feb 2014 08:23:47 +0000
To: public-qt-comments@w3.org
Message-ID: <bug-24726-523@http.www.w3.org/Bugs/Public/>
https://www.w3.org/Bugs/Public/show_bug.cgi?id=24726

            Bug ID: 24726
           Summary: map:new() and map:merge()
           Product: XPath / XQuery / XSLT
           Version: Working drafts
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XSLT 3.0
          Assignee: mike@saxonica.com
          Reporter: jonathan.robie@gmail.com
        QA Contact: public-qt-comments@w3.org

XPath can now create empty arrays or create arrays from literals, two of the
uses of map:new().  

The third use is to merge arrays - for this purpose it would be helpful to have
a more meaningful name.  Consider the following two expressions, which differ
only by the name of the function:

$map => map:new( { "counter" : $map($key) + 1 } )

$map => map:merge( { "counter" : $map($key) + 1 } )

To my eyes, the meaning is much more obvious with  the name map:merge().

I suggest:

1. Either keep the zero-arity and 1-arity map:new() as is or drop them in favor
of the new constructors.

2. Create a new function called map:merge() with the same semantics as the
current map:new() with arity greater than 1

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
Received on Wednesday, 19 February 2014 08:23:53 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:57:46 UTC