@@ -290,6+290,7 @@ Here are the beginnings of functions to move from one focused tree to another:
# next2 ();;
- : int option = None
# next2 ();;
- : int option = None
+<a id=streams1></a>
## Same-fringe using streams ##
Now we'll describe a different way to create "the little subprograms" that we built above with `make_fringe_enumerator`. This code will make use of a data structure called a "stream". A stream is like a list in that it wraps a series of elements of a single type. It differs from a list in that the tail of the series is left uncomputed until needed. We turn the stream off and on by thunking it, nad by forcing the thunk.
## Same-fringe using streams ##
Now we'll describe a different way to create "the little subprograms" that we built above with `make_fringe_enumerator`. This code will make use of a data structure called a "stream". A stream is like a list in that it wraps a series of elements of a single type. It differs from a list in that the tail of the series is left uncomputed until needed. We turn the stream off and on by thunking it, nad by forcing the thunk.
@@ -364,6+365,7 @@ Some other Scheme details or reminders:
<!-- -->
<!-- -->
+<a id=streams2></a>
4. Here is the Scheme code handling the same-fringe problem. You should fill in the blanks:
(define (lazy-flatten tree)
4. Here is the Scheme code handling the same-fringe problem. You should fill in the blanks: