There's nothing specific to fold-right here. It's a general property that when 
we specify functions using algorithms like this, the algorithms are not 
designed to be efficient. And in turn, that's a property of specifications in 
general, not just this one. It's the way standards work.

Michael Kay
Saxonica


> On 12 Jan 2017, at 17:21, W.S. Hager <wsha...@gmail.com> wrote:
> 
> 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 <wsha...@gmail.com 
> <mailto:wsha...@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 <m...@saxonica.com 
> <mailto:m...@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 <http://lagua.nl/>
> 
> 
> 
> -- 
> W.S. Hager
> Lagua Web Solutions
> http://lagua.nl <http://lagua.nl/>

_______________________________________________
talk@x-query.com
http://x-query.com/mailman/listinfo/talk

Reply via email to