2 ms·
It's a shame the author never actually ran the code, it has bugs. For example, the Factorial next() function should be: return new Factorial (index + 1, val
by dmolony 8y ago
It's a shame the author never actually ran the code, it has bugs.
For example, the Factorial next() function should be:
return new Factorial (index + 1, value * (index + 1));
And of course the iterate line should be:
Stream.iterate (Factorial.SEED, Factorial::next)