On Thu, 2017-01-12 at 13:21 +0100, W.S. Hager wrote:
> Hello,
> 
> Not sure if anyone already noticed, but there's an error in the
> XPath/XQuery F&O docs, where the example implementation of array:fold
> will always return an array...
I don't believe so. Please open a bug report (see the status section of
the document for details on how to do that).

> More importantly, it seems to me that a textbook implementation of
> fold-right was used, without the notice that this will only work in a
> lazy evaluation context.

XQuery is designed so that a hybrid lazy evaluation strategy is
encouraged. Queries are rewritten extensively by many implementations.
Having said that, we don't provide e.g. infinite sequences, so it's
also possible to implement an entirely eager XQuery.

The example implementations here and there in the spec are not
necessarily efficient but they should (unless otherwise noted in the
text) be correct in all cases.

Liam


-- 
Liam R. E. Quin <l...@w3.org>
The World Wide Web Consortium (W3C)
_______________________________________________
talk@x-query.com
http://x-query.com/mailman/listinfo/talk

Reply via email to