Mir Random [WIP]
Kagamin via Digitalmars-d
digitalmars-d at puremagic.com
Wed Nov 23 07:29:14 PST 2016
On Wednesday, 23 November 2016 at 14:30:53 UTC, Andrei
Alexandrescu wrote:
> This claim would apply to all ranges. There seems to be
> evidence it is unfounded.
>
> The main argument for using the range interface for RNGs is
> reuse of abstraction. Minute implementation matters are much
> less important. The main counter-argument is that the
> abstraction is not fitting well and another abstraction (such
> as opCall) is more advantageous.
Consider this okayish looking code:
consume(rng());
consume(rng.take(2)); //reuses previous value
consume(rng()); //discards unused value
More information about the Digitalmars-d
mailing list