[xquery-talk] Fold-right

W.S. Hager wshager at gmail.com
Thu Jan 12 09:21:56 PST 2017


Better still, remove fold-right entirely, since laziness isn't part of the
spec (specifically infinite lists).

2017-01-12 18:10 GMT+01:00 W.S. Hager <wshager at gmail.com>:

> Can we please agree to add a footnote to the fold-right example that says
> something along the lines of "this example algorithm may be optimized using
> lazy evaluation in the interpreter"? I don't see how that is biasing the
> spec toward a specific implementation...
>
> 2017-01-12 17:27 GMT+01:00 Michael Kay <mike at saxonica.com>:
>
>> >
>> > Agreed, but that wasn't my point. You may have the opinion that it
>> wasn't important, but I'm curious to know where anything tangible on
>> laziness is mentioned.
>>
>> It isn't - deliberately. We leave "quality of implementation" issues
>> entirely to the implementor. There are many implementation techniques
>> available, including ones that may not have been invented yet, and there
>> are different trade-offs between time and memory, and the spec quite
>> deliberately doesn't get involved in such matters. The spec tells you what
>> result to expect, it doesn't tell you when to expect it.
>>
>> Michael Kay
>> Saxonica
>>
>>
>> > As you say, not having any won't be very efficient, so you may as well
>> be explicit about it, right? I don't really understand why it's preferable
>> to have a syntax without an implementation, and I simply pointed out that
>> in the case of the fold-right example that becomes slightly odd...
>>
>>
>
>
> --
>
> W.S. Hager
> Lagua Web Solutions
> http://lagua.nl
>



-- 

W.S. Hager
Lagua Web Solutions
http://lagua.nl
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://x-query.com/pipermail/talk/attachments/20170112/7cd92678/attachment.html>


More information about the talk mailing list