<div dir="ltr">That's why, for cases where it's possible, I preferred to write the simple mapping operator, as it's easier to read IMO. <div class="gmail_extra"><br><div class="gmail_quote">2017-08-02 12:07 GMT+02:00 W.S. Hager <span dir="ltr"><<a href="mailto:wshager@gmail.com" target="_blank">wshager@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Hi Ghislain,</div><div><br></div>Alright, I forgot about fn:replace#4, but the implicit binding is sometimes hard to detect.<div><br></div><div>Thanks.<div><div class="h5"><br><div class="gmail_extra"><br><div class="gmail_quote">2017-08-02 12:04 GMT+02:00 Ghislain  Fourny <span dir="ltr"><<a href="mailto:gfourny@inf.ethz.ch" target="_blank">gfourny@inf.ethz.ch</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">... I didn't get it quite right actually. In @address => string(), there is no context item involved, I wrote too fast. :-)<br>
<br>
New attempt:<br>
<span><br>
@address ! string(.) (: explicitly passed context item :)<br>
@address ! string() (: context item passed implicitly to string#0, which is context-dependent)<br>
</span>@address => string() (: @address passed implicitly to string#1 as the first parameter via the => operator, but string#1 is context-independent)<br>
@address => string(.) (: error: string#2 does not exist :)<br>
<br>
Kind regards,<br>
Ghislain<br>
<div class="m_-855537475678694297HOEnZb"><div class="m_-855537475678694297h5"><br>
<br>
> On 2 Aug 2017, at 12:00, Ghislain Fourny <<a href="mailto:gfourny@inf.ethz.ch" target="_blank">gfourny@inf.ethz.ch</a>> wrote:<br>
><br>
> Dear Wouter,<br>
><br>
> There is one more important difference on the syntactic level.<br>
><br>
> With the arrow operator, the left-hand-side is implicitly bound to the first parameter of the function.<br>
><br>
> @address => replace(@postcode, "", "q")<br>
><br>
> is the same as<br>
><br>
> replace(@address, @postcode, "", "q")<br>
><br>
><br>
> With the simple map operator, the context item must be explicitly referred to, like so:<br>
><br>
> @address ! replace(., @postcode, "", "q")<br>
><br>
><br>
> What may create confusion is that some functions have several signatures, some of which implicitly refer to the context item. But this is a very different mechanism.<br>
><br>
> For example :<br>
><br>
> @address ! string(.) (: explicitly passed context item :)<br>
> @address ! string() (: context item passed implicitly to string#0, which is context-dependent)<br>
> @address => string() (: context item passed implicitly to string#1 via the => operator, but string#1 is context-independent)<br>
><br>
> I hope I got it right!<br>
><br>
> Kind regards,<br>
> Ghislain<br>
><br>
><br>
>> On 2 Aug 2017, at 11:27, W.S. Hager <<a href="mailto:wshager@gmail.com" target="_blank">wshager@gmail.com</a>> wrote:<br>
>><br>
>> Hi Michael,<br>
>><br>
>> The way you used the arrow operator in the example would be the way I expected it to work, namely by explicitly addressing the context, but it seems that it doesn't. It's actually implicitly binding the first argument of the function on the right to the value on the left. Or is there an exception I don't know about?<br>
>><br>
>> Thanks.<br>
>><br>
>> Op 1 aug. 2017 18:58 schreef "Michael Kay" <<a href="mailto:mike@saxonica.com" target="_blank">mike@saxonica.com</a>>:<br>
>> In the case of singletons there's very little difference, but (as I now see Christian has pointed out), with sequences the effect is quite different.<br>
>><br>
>> Also, of course, "!" changes the context item, so<br>
>><br>
>> @address => replace(@postcode, "", "q") works, while<br>
>><br>
>> @address ! replace(@postcode, "", "q") doesn't.<br>
>><br>
>> Michael Kay<br>
>> Saxonica<br>
>><br>
>>> On 1 Aug 2017, at 13:27, W.S. Hager <<a href="mailto:wshager@gmail.com" target="_blank">wshager@gmail.com</a>> wrote:<br>
>>><br>
>>> Hi,<br>
>>><br>
>>> Is there any advantage to using the 3.1 arrow operator over the simple map operator?<br>
>>><br>
>>> $string => upper-case() => normalize-unicode() => tokenize("\s+")<br>
>>><br>
>>> versus<br>
>>><br>
>>> $string ! upper-case(.) ! normalize-unicode(.) ! tokenize(.,"\s+")<br>
>>><br>
>>> Thanks,<br>
>>> Wouter<br>
>>> ______________________________<wbr>_________________<br>
>>> <a href="mailto:talk@x-query.com" target="_blank">talk@x-query.com</a><br>
>>> <a href="http://x-query.com/mailman/listinfo/talk" rel="noreferrer" target="_blank">http://x-query.com/mailman/lis<wbr>tinfo/talk</a><br>
>><br>
>><br>
>> ______________________________<wbr>_________________<br>
>> <a href="mailto:talk@x-query.com" target="_blank">talk@x-query.com</a><br>
>> <a href="http://x-query.com/mailman/listinfo/talk" rel="noreferrer" target="_blank">http://x-query.com/mailman/lis<wbr>tinfo/talk</a><br>
><br>
<br>
</div></div></blockquote></div><br><div class="m_-855537475678694297gmail_signature" data-smartmail="gmail_signature"><div><p><br></p></div></div>
</div></div></div></div></div>
</blockquote></div><div class="gmail_signature" data-smartmail="gmail_signature"><div><p><br></p></div></div>
</div></div>