<p dir="ltr">I don't want this ints() to be confused with the one you want to add to generators. So I would name it intStream() or randomInts().</p>
<div class="gmail_quote">On Dec 31, 2012 10:41 AM, "Brian Goetz" <<a href="mailto:brian.goetz@oracle.com">brian.goetz@oracle.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On the list of requested stream sources is 'stream of random numbers'.<br>
<br>
Here's a one-line addition to Random:<br>
<br>
public IntStream ints() {<br>
return PrimitiveStreams.repeatedly(<u></u>this::nextInt);<br>
}<br>
<br>
Certainly the implementation is straightforward enough (modulo renaming of PrimitiveStreams and repeatedly, which are not yet nailed down.)<br>
<br>
Any objections here? Clearly we'd want to support streams of ints, longs, and doubles, so just calling it stream() is wrong; should they be called random.ints(), or random.intStream()?<br>
<br>
<br>
</blockquote></div>