(define(any? pred lst)(cond((null? lst)#f)((pred (car lst))#t)(else(any? pred (cdr lst)))))(define(stream-map proc . streams)(if(any? stream-null? streams)
empty-stream
(stream-cons
(apply proc (map stream-car streams))(apply stream-map
proc ; We don't need to cons proc and the result of map.
(map stream-cdr streams)))))
Beckett
argstreams is a list of list, not a stream, we should not use stream-xxx procs on it.
Patrick-OHara
That implementation assumes that the streams are the same length (perhaps infinite). In order to cope with streams of different lengths I have this:
Shade
A bit cleaner:
sanggggg
to Beckett, i think argstream is a list of stream not list of list. so it is correct to map it by stream-xxx. (map each stream by stream-xxx)