generator-scatter will unroll a generator of generators as flat generator.
That's pretty cool, and I wish I had thought of it for SRFI 158. However, the word
"scatter" suggests taking things from a single place and putting them into many places.
I think a better name would be gconcatenate.
nstore-query will chain generators operations. Here is the
implementation:
I've been thinking about chained generators for a while, but I haven't got anything
that suits me yet. I also have thought about the function accumulate-generated-values,
which generates all the values of its first argument and accumulates them in its second
argument. If can find something I like for chaining, I'll issue a replacement for SRFI 158.
I'd want the chaining operator to be a function operating on generators and g-functions
rather than a macro. What might be a Good Thing, though, is a wrapper (function or macro)
that provides the boilerplate for writing generators, and you just pass in a function
or representation of a function (if it's a macro) that accepts an argument, the current
state, and returns two values, the generated result and the new state.