On Sat, Nov 24, 2012 at 1:38 AM, Per Bothner <[email protected]> wrote:
> On 11/23/2012 12:52 AM, Alex Shinn wrote: > >> I still find this a surprising concept. Do you have programs >> which currently produce infinite unbounded output intentionally? >> > > Any daemon or server written in a pure functional (lazy) style. > > Likewise any Unix-style transducer (pipe) hooked up to unbounded input. > > Such a program might have a pure lazy part that produces as a > result a lazy string or list. Then a small driver part interacts > with the world - and the simplest to do that is to just display > or write[-simple] the result, > I think it's safe to say lazy strings are outside the scope of R7RS. I was curious about lazy lists - since the list is not complete until the closing parenthesis (which will never come) it's generally impossible to actually use the output. So if you want to implement the Unix yes(1), you can just write (do () (#f) (display "yes\n")), or if you have lazy strings you can take a more round-about approach of (display (make-lazy-string-of-repeated-yes)). But the display of a list is unspecified to begin with and doesn't seem useful. -- Alex
_______________________________________________ Scheme-reports mailing list [email protected] http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports
