Should the car be a stream? AndrevanTonder (14 Nov 2007 23:47 UTC)
Re: Should the car be a stream? Phil Bewig (15 Nov 2007 00:22 UTC)
Re: Should the car be a stream? David Van Horn (15 Nov 2007 01:21 UTC)
Re: Should the car be a stream? Phil Bewig (15 Nov 2007 01:48 UTC)
Re: Should the car be a stream? AndrevanTonder (15 Nov 2007 13:19 UTC)
Re: Should the car be a stream? Jos Koot (15 Nov 2007 13:55 UTC)
Re: Should the car be a stream? AndrevanTonder (15 Nov 2007 14:46 UTC)

Should the car be a stream? AndrevanTonder 14 Nov 2007 23:47 UTC

The following seems wrongly typed to me:

(define-syntax stream-cons
     (syntax-rules ()
       ((stream-cons obj strm)
         (stream-delay (make-stream-pare
                           (stream-delay obj)   ;???
                           (stream-lazy strm))))))

Specifically, I don't think the car of a stream should be a stream.
Instead, shouldn't it be something like

(define-syntax stream-cons
     (syntax-rules ()
       ((stream-cons obj strm)
         (stream-delay (make-stream-pare
                           (delay obj)
                           (stream-lazy 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.

Andre