<div dir="ltr"><div>+1 for <br></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">X => map:for-each(A, ?) meaning map:for-each(A, X)</span><br style="font-size:12.8px"></div><div class="gmail_extra"><br></div><div class="gmail_extra">Jim Fuller</div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Jan 10, 2016 at 11:03 PM, Adam Retter <span dir="ltr"><<a href="mailto:adam.retter@googlemail.com" target="_blank">adam.retter@googlemail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Thanks Mike, that is exactly the kinda detail I needed, and the bug<br>
report has many good comments.<br>
<br>
Personally I do like the idea and syntax from an XQuery authoring<br>
perspective of being able to do:<br>
<br>
X => map:for-each(A, ?) meaning map:for-each(A, X)<br>
<br>
However, I am not precious about it. So whichever way it is decided,<br>
as long as the spec defines, I will be both happy and informed ;-)<br>
<br>
Thanks again. Adam.<br>
<div class="HOEnZb"><div class="h5"><br>
On 10 January 2016 at 21:51, Michael Kay <<a href="mailto:mike@saxonica.com">mike@saxonica.com</a>> wrote:<br>
> There's an open bug against the spec on the use of ?-placeholders in conjunction with the arrow operator.<br>
><br>
> <a href="https://www.w3.org/Bugs/Public/show_bug.cgi?id=29346" rel="noreferrer" target="_blank">https://www.w3.org/Bugs/Public/show_bug.cgi?id=29346</a><br>
><br>
> The grammar allows it, but the semantics have not been specified.<br>
><br>
> My own view is that<br>
><br>
> X => map:for-each(A, ?)<br>
><br>
> should mean<br>
><br>
> map:for-each(X, A, ?)<br>
><br>
> which is an error because there are too many arguments.<br>
><br>
> But we need to await the WG decision on this bug.<br>
><br>
> Michael Kay<br>
> Saxonica<br>
><br>
><br>
>> On 10 Jan 2016, at 19:30, Adam Retter <<a href="mailto:adam.retter@googlemail.com">adam.retter@googlemail.com</a>> wrote:<br>
>><br>
>> Given this valid XQuery (1):<br>
>><br>
>> map:for-each(<br>
>>    map {<br>
>>        "a" : "1",<br>
>>        "b" : "2",<br>
>>        "c" : "3"<br>
>>    },<br>
>>    ?<br>
>> )(function($k, $v) {<br>
>>    "$k=" || $k<br>
>> })<br>
>><br>
>> I am wondering, if rewriting it to the following form results in a<br>
>> valid query with the same execution result (2):<br>
>><br>
>> function($k, $v) {<br>
>>    "$k=" || $k<br>
>> } =><br>
>>    map:for-each(<br>
>>        map {<br>
>>            "a" : "1",<br>
>>            "b" : "2",<br>
>>            "c" : "3"<br>
>>        },<br>
>>        ?<br>
>>    )()<br>
>><br>
>> In my mind it does, however I can't find a current implementation<br>
>> (eXist, BaseX, Saxon-EE) which will execute it, I guess this is due to<br>
>> evaluation order of the expressions (although I get parser errors).<br>
>><br>
>> If I add some brackets to (2), to add precedence to the evaluation<br>
>> order so that I have (3):<br>
>><br>
>> function($k, $v) {<br>
>>    "$k=" || $k<br>
>> } =><br>
>>    (<br>
>>    map:for-each(<br>
>>        map {<br>
>>            "a" : "1",<br>
>>            "b" : "2",<br>
>>            "c" : "3"<br>
>>        },<br>
>>        ?<br>
>>    ))()<br>
>><br>
>><br>
>> Then it does seem to execute on BaseX and Saxon, but it feels like I<br>
>> shouldn't need to add the brackets and that (2) should work! Can<br>
>> someone add some comment/insight for me as to whether the XQuery spec<br>
>> requires these brackets to make the parse and execution correct?<br>
>> Somehow, I can't see it at the moment...<br>
>><br>
>><br>
>> Thanks Adam.<br>
>><br>
>> --<br>
>> Adam Retter<br>
>><br>
>> skype: adam.retter<br>
>> tweet: adamretter<br>
>> <a href="http://www.adamretter.org.uk" rel="noreferrer" target="_blank">http://www.adamretter.org.uk</a><br>
>> _______________________________________________<br>
>> <a href="mailto:talk@x-query.com">talk@x-query.com</a><br>
>> <a href="http://x-query.com/mailman/listinfo/talk" rel="noreferrer" target="_blank">http://x-query.com/mailman/listinfo/talk</a><br>
><br>
><br>
<br>
<br>
<br>
--<br>
Adam Retter<br>
<br>
skype: adam.retter<br>
tweet: adamretter<br>
<a href="http://www.adamretter.org.uk" rel="noreferrer" target="_blank">http://www.adamretter.org.uk</a><br>
_______________________________________________<br>
<a href="mailto:talk@x-query.com">talk@x-query.com</a><br>
<a href="http://x-query.com/mailman/listinfo/talk" rel="noreferrer" target="_blank">http://x-query.com/mailman/listinfo/talk</a><br>
</div></div></blockquote></div><br></div></div>