Mosquito's implementation of iterators was derived from "
SRFI-1: List Library," and restricted itself mostly to iterating over lists, much like the original. Since Mosquito and Wasp have much richer type libraries, it makes sense to generalize these functions to support other primitive sequence types, such as Sets, Dictionaries, Vectors and Channels. (Yes, channels can be considered sequences of a sort.)
It is now possible to do the following:
>> (for-each send (current-input))
The input yielded by
(current-input) is applied to the
(iter value) function, which yields an iteration thunk. That thunk is called repeatedly by for-each until it raises a
(done why) error. A slightly less verbose version:
>> (for-each send wait)
The iterator for a function is the function itself; iter makes the assumption that the supplied function is a generator. Part of this was already done in Mosquito, but only a couple functions supported it, it was never documented, and most sequences had to be converted into an intermediate list. Those oversights have been corrected.
I am going on vacation this week, so, either expect a lot of changes, or none at all, next weekend. Waspdoc now lists all functions exported by a module, identifies its imports, and is coming along nicely.