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

https://www.w3.org/Bugs/Public/show_bug.cgi?id=24726

--- Comment #2 from Jonathan Robie <jonathan.robie@gmail.com> ---
Hi Mike,

I must be exhausted, I don't know why I said 'arrays' when I meant 'maps'. Here
is the corrected text.

----------------------

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

The third use is to merge maps - 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 17:23:18 UTC