Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (define (cycle-lists xs ys)
- (define (get-stream-by-array xs)
- (letrec ([f (lambda (x)
- (if (= x (- (length xs) 1))
- (cons (list-ref xs x) (lambda () (f 0)))
- (cons (list-ref xs x) (lambda () (f (+ x 1))))))])
- (lambda () (f 0))))
- (define (cycle-streams s1 s2)
- (lambda () (cons (cons (car (s1)) (car (s2))) (cycle-streams (cdr (s1)) (cdr (s2))))))
- (cycle-streams (get-stream-by-array xs) (get-stream-by-array ys)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement