Scheme streams and circular lists
问题 In Scheme/Lisp I am trying to make a function that converts a list into a circular list. Therefore, I believe I need to construct an infinite stream in which the tail of the list points to the head of the list. Here is my code so far: (define (rotate-list l1 l1copy) (if (null? (force (cdr l1))) (cons (car l1) (delay l1copy))) (cons (car l1) (delay (rotate-list (force (cdr l1)) l1copy)))) All help is greatly appreciated. 回答1: No, you don't need streams to make a circular list. There are two