[xquery-talk] arrow operator

W.S. Hager wshager at gmail.com
Wed Aug 2 02:27:06 PDT 2017

Hi Michael,

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?


Op 1 aug. 2017 18:58 schreef "Michael Kay" <mike at saxonica.com>:

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.

Also, of course, "!" changes the context item, so

@address => replace(@postcode, "", "q") works, while

@address ! replace(@postcode, "", "q") doesn't.

Michael Kay

> On 1 Aug 2017, at 13:27, W.S. Hager <wshager at gmail.com> wrote:
> Hi,
> Is there any advantage to using the 3.1 arrow operator over the simple
map operator?
> $string => upper-case() => normalize-unicode() => tokenize("\s+")
> versus
> $string ! upper-case(.) ! normalize-unicode(.) ! tokenize(.,"\s+")
> Thanks,
> Wouter
> _______________________________________________
> talk at x-query.com
> http://x-query.com/mailman/listinfo/talk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://x-query.com/pipermail/talk/attachments/20170802/3ae3c920/attachment.html>

More information about the talk mailing list