"argstreams is a list of list": Then this is just the original general map. As the normal stream-map is on stream, so the general stream-map is on a list of streams where list is implied by how we pass args, i.e. . argstreams.

(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 ; No need to cons proc and the result of map.
(map stream-cdr streams)))))

IMHO "That implementation assumes that the streams are the same length (perhaps infinite)." is right. But Patrick-OHara's implementation is wrong since that may call proc with the wrong number of args. So we need to exit in that case as Shade does.

---

Also here the exercise assumes argstreams is not null which is same as the general map.

`(define (stream-map proc . argstreams) (if (stream-null? (car argstreams)) the-empty-stream (cons-stream (apply proc (map stream-car argstreams)) (apply stream-map (cons proc (map stream-cdr argstreams))))))`

Beckett

argstreams is a list of list, not a stream, we should not use stream-xxx procs on it.

`(define (stream-map proc . argstreams) (if (stream-null? (car argstreams)) the-empty-stream (cons-stream (proc (map car argstreams)) (apply stream-map (cons proc (map cdr argstreams))))))`

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)

LisScheSic

"argstreams is a list of list": Then this is just the original general

map. As the normalstream-mapis on stream, so the generalstream-mapis on a list of streams where list is implied by how we pass args, i.e.. argstreams.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:

LisScheSic

IMHO "That implementation assumes that the streams are the same length (perhaps infinite)." is right. But Patrick-OHara's implementation is wrong since that may call

procwith thewrong number of args. So we need to exit in that case as Shade does.---

Also here the exercise assumes

argstreamsis not null which is same as the generalmap.