[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Should the car be a stream?
This page is part of the web mail archives of SRFI 41 from before July 7th, 2015. The new archives for SRFI 41 contain all messages, not just those from before July 7th, 2015.
- To: AndrevanTonder <andre@xxxxxxxxxxxxx>
- Subject: Re: Should the car be a stream?
- From: "Phil Bewig" <pbewig@xxxxxxxxx>
- Date: Wed, 14 Nov 2007 18:22:24 -0600
- Cc: srfi-41@xxxxxxxxxxxxxxxxx
- Delivered-to: srfi-41@xxxxxxxxxxxxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; bh=1dkg08t9xo3zymR9qpH0/8VaR8Ul8TeUxPjutJQCpkU=; b=k17idF4pyQrcEF1nINXQ2yJmvkH/u6L/QLl1opYKzD3M3PCUghpLu/JjipqsxLRxZoTgSjul93oksSadMm/4LUXm1J+lrA6eHlFzRX3l6YnNjzlD/33OITGGBJUHWBGjqPsHH6ehnjzP1GzB6BBaD9UJLLFccdE/fejzTiKAQ+I=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=P3GN/I/yn7Li9+4s4Rhn9N4X8I408yWVf6UmBujIBM7w8HAUw7j7Skp5EZsBkBS5AhR/y12HSsKO6c9MVHMTQiAExImHXA9PH54TstTfdDsFtSS9NB4JC6Hka0qOIBTTCfFBxSo1UPmn6zSgPmxKNu/RoMUVTtT50dgXqRhqV64=
- In-reply-to: <Pine.SOC.4.64.0711141826090.20861@xxxxxxxxxxxxxxxxx>
- References: <Pine.SOC.4.64.0711141826090.20861@xxxxxxxxxxxxxxxxx>
At one point in the development of the SRFI the stream-car wasn't delayed. But that doesn't work, because Scheme is eager, not lazy, so evaluation of the stream-car has to be delayed. See the typing discussion in the 'Implementation' section for more discussion of this point.
On Nov 14, 2007 5:47 PM, AndrevanTonder <andre@xxxxxxxxxxxxx
The following seems wrongly typed to me:
((stream-cons obj strm)
(stream-delay obj) ;???
Specifically, I don't think the car of a stream should be a stream.
Instead, shouldn't it be something like
((stream-cons obj strm)
But even I am wondering about the rationale for making the stream elements
themselves promises. It may be useful to leave the types of the elements
(including whether they are promises or ordinary values) orthogonal to the
backbone of the stream itself.
I suspect that if the elements were not themselves delayed by default, you
would see a huge difference in performance.