http://d.puremagic.com/issues/show_bug.cgi?id=5849
--- Comment #8 from [email protected] 2013-08-31 17:47:46 PDT --- (In reply to comment #7) > import std.stdio, std.random, std.range; > void main() { > immutable probabilities = [0.2, 0.6, 0.1, 0.1]; > immutable values = "ACGT"; > probabilities.diceRange(values).take(10).writeln; > } > > > This is quite handy. If the second optional argument is not supported, then the code becomes: import std.stdio, std.random, std.range; void main() { immutable probabilities = [0.2, 0.6, 0.1, 0.1]; immutable values = "ACGT"; probabilities.diceRange.map!(i => values[i]).take(10).writeln; } But I am not sure it's strictly equivalent. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
