Stream generators (original) (raw)
Brian Goetz brian.goetz at oracle.com
Fri Nov 30 09:21:37 PST 2012
- Previous message: Early/late binding to data source
- Next message: Stream generators
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
We've got a few generators for infinite streams already implemented. For object streams:
// produces seed, f(seed), f(f(seed)), ... iterate(T seed, UnaryOperator f)
// infinite constant sequence repeat(T t)
// finite constant sequence repeat(int n, T t)
// infinite sequence driven by a supplier function repeatedly(Supplier f)
// finite sequence driven by a supplier function repeatedly(int n, Supplier f)
// infinitely cycle through an Iterable cycle(Iterable iterable)
For integer streams, the above, plus
range(int from, int to) range(int from, int to, int step)
Ignoring naming for the time being:
- Do these carry their weight?
- Are we missing any?
- What related functionality are we missing that might undermine the utility of these (e.g., zip)?
- Previous message: Early/late binding to data source
- Next message: Stream generators
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the lambda-libs-spec-observers mailing list