Stream generators

Remi Forax forax at univ-mlv.fr
Fri Nov 30 11:53:27 PST 2012


I don't think that infinite streams pull their weight,
I've had lab for 2 or 3 years where students play with with infinite 
iterators and lists,
and it was always evaluated by student (our students grade labs, TA, 
profs etc.)
as too difficult so the lab was eventually replaced.

Rémi

On 11/30/2012 06:21 PM, Brian Goetz wrote:
> We've got a few generators for infinite streams already implemented. 
> For object streams:
>
>   // produces seed, f(seed), f(f(seed)), ...
>   <T> iterate(T seed, UnaryOperator<T> f)
>
>   // infinite constant sequence
>   <T> repeat(T t)
>
>   // finite constant sequence
>   <T> repeat(int n, T t)
>
>   // infinite sequence driven by a supplier function
>   <T> repeatedly(Supplier<T> f)
>
>   // finite sequence driven by a supplier function
>   <T> repeatedly(int n, Supplier<T> f)
>
>   // infinitely cycle through an Iterable
>   <T> cycle(Iterable<T> 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)?
>



More information about the lambda-libs-spec-observers mailing list