[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Scheme-reports] Formal Comment: what is the required behavior of 'lazy'?



Richard Kelsey scripsit:

> This seems overly coy.  What matters is heap space, not whether the
> call to 'force' is a tail call.  How about something like:
> 
>  (delay-force expression) is identical to (delay (force expression)),
>  with the additional requirement that implementations must support
>  tail-recurive nesting of delay-force (where expression returns the
>  result of a second use of delay-force) to arbitrary depths.  This
>  allows delay-force to be used to write lazy, iterative loops as in
>  the stream-filter example below.  See section 7.3 for an example of
>  how delay-force can be implemented.

The report as a whole talks about proper tail recursion, not about
safety for space, and it has always been the case that implementations
like Chicken, which are only asymptotically safe for space, have been
considered properly tail recursive.  I'd prefer to talk of proper tail
recursion here also, so I reject this language.  Another WG member may
of course disagree, in which case it'll go on the ballot as an editorial
disagreement, but no ticket filed yet.

-- 
John Cowan  cowan@x  http://ccil.org/~cowan
If I have seen farther than others, it is because I was standing on
the shoulders of giants.
        --Isaac Newton

_______________________________________________
Scheme-reports mailing list
Scheme-reports@x
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports