I'm trying to build a stream without using the common definition of the form: (define <stream-name> (cons-stream val1 (cons-stream val2 ... (cons stream valN <stream-name>)))))).....) I'm having trouble referencing the actual stream at the end of values list. This all leads up to the function rational->xreal which builds a stream recursing trough the rational .... How do you create such a stream without the regular definition? I think this may also be a mroe generalized problem: Given a finite list of values val1, ..., valN How do you create a stream to contain an infinitely repeating sequence of such values in the exact order they are given in the list. |
You may specify any length of head to a stream, then repeat by Mike O'Donnell, 2002, Nov 19
to: