
Dec. 8, 2013
9:40 a.m.
On Mon, Dec 9, 2013 at 2:34 AM, Stephen J. Turnbull <stephen@xemacs.org> wrote:
Chris Angelico writes:
How are you going to take the next n items from dice_roller without advancing it?
Memoize.
That's not a building-block then, that's a quite separate feature. In this particular instance there's no way to distinguish between "predict the next three but don't advance the iterator" and "advance the iterator by three and then rewind it the same distance", but imagine an iterators that blocks for input, or something. You don't want a purportedly low-level function (from which you derive the more "usable" functions) doing memoization on that. ChrisA